diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafServletAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafServletAutoConfigurationTests.java index 205069e8ec..9f58eefb4a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafServletAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafServletAutoConfigurationTests.java @@ -46,7 +46,6 @@ import org.springframework.boot.test.context.runner.WebApplicationContextRunner; import org.springframework.boot.test.system.CapturedOutput; import org.springframework.boot.test.system.OutputCaptureExtension; import org.springframework.boot.testsupport.BuildOutput; -import org.springframework.boot.testsupport.classpath.ClassPathExclusions; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.boot.web.servlet.filter.OrderedCharacterEncodingFilter; import org.springframework.context.annotation.Bean; @@ -61,6 +60,7 @@ import org.springframework.test.util.ReflectionTestUtils; import org.springframework.web.servlet.ViewResolver; import org.springframework.web.servlet.resource.ResourceUrlEncodingFilter; import org.springframework.web.servlet.support.RequestContext; +import org.springframework.web.servlet.view.AbstractCachingViewResolver; import static org.assertj.core.api.Assertions.assertThat; @@ -338,9 +338,8 @@ class ThymeleafServletAutoConfigurationTests { } @Test - @ClassPathExclusions("spring-webmvc-*.jar") void missingAbstractCachingViewResolver() { - this.contextRunner + this.contextRunner.withClassLoader(new FilteredClassLoader(AbstractCachingViewResolver.class)) .run((context) -> assertThat(context).hasNotFailed().doesNotHaveBean("thymeleafViewResolver")); }