假设我有一个Map<String, Action>
,我会这样:
assertThat( spyActionMap.get( "a" ) ).isInstanceOf( Action.class );
...通过。现在我想检查Action
获得的是正确的:
assertThat( spyActionMap.get( "a" ) ).isInstanceOf( Action.class ).getValue( Action.NAME ).isEqualTo( "Go crazy" );
...不编译,不足为奇。有没有办法做这种事情?