Fixing NPE in AbstractNamedValueMethodArgumentResolver

See gh-23882
This commit is contained in:
Dekel Pilli
2019-10-29 12:10:48 +11:00
committed by Rossen Stoyanchev
parent fd9678833f
commit 64f2beb9bf
4 changed files with 13 additions and 4 deletions

View File

@@ -145,6 +145,14 @@ public class HeaderMethodArgumentResolverTests {
assertThat(result).isEqualTo(Optional.of("bar"));
}
@Test
public void resolveOptionalHeaderWithValueFromNullConversionServiceInput() throws Exception {
GenericApplicationContext context = new GenericApplicationContext();
context.refresh();
resolver = new HeaderMethodArgumentResolver(null, context.getBeanFactory());
resolveOptionalHeaderWithValue();
}
@Test
public void resolveOptionalHeaderAsEmpty() throws Exception {
Message<String> message = MessageBuilder.withPayload("foo").build();