diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfigurationTests.java index 50a20e59b9..e5129b9938 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfigurationTests.java @@ -39,7 +39,6 @@ import org.springframework.http.client.ClientHttpRequest; import org.springframework.http.client.ClientHttpResponse; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.stereotype.Controller; -import org.springframework.test.util.ReflectionTestUtils; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.client.RestTemplate; @@ -189,7 +188,7 @@ public class MultipartAutoConfigurationTests { } @Test - public void containerWithCommonsMultipartResolver() throws Exception { + public void containerWithCommonsMultipartResolver() { this.context = new AnnotationConfigServletWebServerApplicationContext( ContainerWithCommonsMultipartResolver.class, BaseConfiguration.class); MultipartResolver multipartResolver = this.context @@ -207,9 +206,7 @@ public class MultipartAutoConfigurationTests { this.context.refresh(); StandardServletMultipartResolver multipartResolver = this.context .getBean(StandardServletMultipartResolver.class); - boolean resolveLazily = (Boolean) ReflectionTestUtils.getField(multipartResolver, - "resolveLazily"); - assertThat(resolveLazily).isTrue(); + assertThat(multipartResolver).hasFieldOrPropertyWithValue("resolveLazily", true); } private void verify404() throws Exception {