Assert.assertThat(refVar.method(), is(null));
Does the code is(null) correct to check whether the refVar.method() returns a null? If not, how do i check whether something is a null or not? I've tried aNull but the IDE says this method does not exist, i tried importing Matcher.* already. Please help.
Null or Not Null
The matchers
aNull<T>(Class<T>)andaNonNull<T>(Class<T>)specify that an argument isnullor isnot null, respectively.The following code specifies that the method "doSomething" must be called with two
strings, the first must benulland the second must benot null.Check this jMock Matchers for more clarifications