ResolvableType.forInstance returns NONE for null instance

Closes gh-28776
This commit is contained in:
Juergen Hoeller
2022-07-13 11:10:35 +02:00
parent de1b938e2e
commit a3e46a2db7
2 changed files with 10 additions and 13 deletions

View File

@@ -146,11 +146,9 @@ class ResolvableTypeTests {
assertThat(typeVariable.isAssignableFrom(raw)).isTrue();
}
@Test
void forInstanceMustNotBeNull() throws Exception {
assertThatIllegalArgumentException()
.isThrownBy(() -> ResolvableType.forInstance(null))
.withMessage("Instance must not be null");
@Test // gh-28776
void forInstanceNull() throws Exception {
assertThat(ResolvableType.forInstance(null)).isEqualTo(ResolvableType.NONE);
}
@Test