どうすればいいassertThatですnullか?
例えば
assertThat(attr.getValue(), is(""));
しかし、私は持つことができないというエラーが表示nullされis(null)ます。
メソッドを使用できますIsNull.nullValue():
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
assertThat(attr.getValue(), is(nullValue()));
なぜassertNull(object)/を使わないのassertNotNull(object)ですか?
あなたがしたいならhamcrest、あなたはすることができます
import static org.hamcrest.Matchers.nullValue;
assertThat(attr.getValue(), is(nullValue()));
あなたJunitができること
import static junit.framework.Assert.assertNull;
assertNull(object);