Consistent use of @Nullable in spring-test
This commit also removes nullability from two common spots: ResolvableType.getType() and TargetSource.getTarget(), both of which are never effectively null with any regular implementation. For such scenarios, a non-null empty type/target is the cleaner contract. Issue: SPR-15540
This commit is contained in:
@@ -56,6 +56,7 @@ import org.springframework.util.MultiValueMap;
|
||||
|
||||
import static org.hamcrest.Matchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.mockito.BDDMockito.any;
|
||||
import static org.mockito.BDDMockito.*;
|
||||
|
||||
/**
|
||||
@@ -86,7 +87,7 @@ public class ResolvableTypeTests {
|
||||
assertThat(none.getGenerics().length, equalTo(0));
|
||||
assertThat(none.getInterfaces().length, equalTo(0));
|
||||
assertThat(none.getSuperType(), equalTo(ResolvableType.NONE));
|
||||
assertThat(none.getType(), nullValue());
|
||||
assertThat(none.getType(), equalTo(ResolvableType.EmptyType.INSTANCE));
|
||||
assertThat(none.hasGenerics(), equalTo(false));
|
||||
assertThat(none.isArray(), equalTo(false));
|
||||
assertThat(none.resolve(), nullValue());
|
||||
|
||||
Reference in New Issue
Block a user