From 2f4325d00f28fec2018f70d50ac6b6adb631d841 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Thu, 15 Nov 2018 09:04:01 +0100 Subject: [PATCH] Polish --- .../web/servlet/MultipartAutoConfigurationTests.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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 {