Browse Source

Merge branch '2.6.x' into 2.7.x

Closes gh-31099
pull/31139/head
Andy Wilkinson 4 years ago
parent
commit
646d582393
  1. 8
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafReactiveAutoConfigurationTests.java
  2. 9
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafServletAutoConfigurationTests.java

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

@ -27,6 +27,7 @@ import org.junit.jupiter.api.extension.ExtendWith; @@ -27,6 +27,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.thymeleaf.TemplateEngine;
import org.thymeleaf.context.Context;
import org.thymeleaf.context.IContext;
import org.thymeleaf.extras.springsecurity5.dialect.SpringSecurityDialect;
import org.thymeleaf.extras.springsecurity5.util.SpringSecurityContextUtils;
import org.thymeleaf.spring5.ISpringWebFluxTemplateEngine;
import org.thymeleaf.spring5.SpringWebFluxTemplateEngine;
@ -36,6 +37,7 @@ import org.thymeleaf.spring5.view.reactive.ThymeleafReactiveViewResolver; @@ -36,6 +37,7 @@ import org.thymeleaf.spring5.view.reactive.ThymeleafReactiveViewResolver;
import org.thymeleaf.templateresolver.ITemplateResolver;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.test.context.FilteredClassLoader;
import org.springframework.boot.test.context.runner.ReactiveWebApplicationContextRunner;
import org.springframework.boot.test.system.CapturedOutput;
import org.springframework.boot.test.system.OutputCaptureExtension;
@ -216,6 +218,12 @@ class ThymeleafReactiveAutoConfigurationTests { @@ -216,6 +218,12 @@ class ThymeleafReactiveAutoConfigurationTests {
});
}
@Test
void securityDialectAutoConfigurationBacksOffWithoutSpringSecurity() {
this.contextRunner.withClassLoader(new FilteredClassLoader("org.springframework.security"))
.run((context) -> assertThat(context).doesNotHaveBean(SpringSecurityDialect.class));
}
@Test
void renderTemplate() {
this.contextRunner.run((context) -> {

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

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -31,6 +31,7 @@ import org.junit.jupiter.api.extension.ExtendWith; @@ -31,6 +31,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.thymeleaf.TemplateEngine;
import org.thymeleaf.context.Context;
import org.thymeleaf.context.WebContext;
import org.thymeleaf.extras.springsecurity5.dialect.SpringSecurityDialect;
import org.thymeleaf.spring5.SpringTemplateEngine;
import org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver;
import org.thymeleaf.spring5.view.ThymeleafView;
@ -231,6 +232,12 @@ class ThymeleafServletAutoConfigurationTests { @@ -231,6 +232,12 @@ class ThymeleafServletAutoConfigurationTests {
});
}
@Test
void securityDialectAutoConfigurationBacksOffWithoutSpringSecurity() {
this.contextRunner.withClassLoader(new FilteredClassLoader("org.springframework.security"))
.run((context) -> assertThat(context).doesNotHaveBean(SpringSecurityDialect.class));
}
@Test
void renderTemplate() {
this.contextRunner.run((context) -> {

Loading…
Cancel
Save