5

看起来很酷

assertThat(yoda).is(jedi);

直到你不知道什么是yodaand jedi。但是假设

yoda instanceof Person

在哪里

interface Person {
    boolean isJedi();
}

那么如何实际检查isJediAssertJ

按照惯例JUnit,我会写

assertTrue( yoda.isJedi() );

但在什么AssertJ

4

1 回答 1

12
assertThat(yoda.isJedi()).isTrue()
于 2016-08-30T13:11:03.017 回答