Skip to content

Commit 6aa0055

Browse files
committed
Polish "Do not auto-configure ViewResolver if spring-webmvc is absent"
See gh-44259
1 parent ac73766 commit 6aa0055

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafServletAutoConfigurationTests.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
import org.springframework.boot.test.system.CapturedOutput;
4747
import org.springframework.boot.test.system.OutputCaptureExtension;
4848
import org.springframework.boot.testsupport.BuildOutput;
49-
import org.springframework.boot.testsupport.classpath.ClassPathExclusions;
5049
import org.springframework.boot.web.servlet.FilterRegistrationBean;
5150
import org.springframework.boot.web.servlet.filter.OrderedCharacterEncodingFilter;
5251
import org.springframework.context.annotation.Bean;
@@ -61,6 +60,7 @@
6160
import org.springframework.web.servlet.ViewResolver;
6261
import org.springframework.web.servlet.resource.ResourceUrlEncodingFilter;
6362
import org.springframework.web.servlet.support.RequestContext;
63+
import org.springframework.web.servlet.view.AbstractCachingViewResolver;
6464

6565
import static org.assertj.core.api.Assertions.assertThat;
6666

@@ -338,9 +338,8 @@ void cachingCanBeDisabled() {
338338
}
339339

340340
@Test
341-
@ClassPathExclusions("spring-webmvc-*.jar")
342341
void missingAbstractCachingViewResolver() {
343-
this.contextRunner
342+
this.contextRunner.withClassLoader(new FilteredClassLoader(AbstractCachingViewResolver.class))
344343
.run((context) -> assertThat(context).hasNotFailed().doesNotHaveBean("thymeleafViewResolver"));
345344
}
346345

0 commit comments

Comments
 (0)