Browse Source

Polish

pull/11839/merge
Andy Wilkinson 8 years ago
parent
commit
6582afea4a
  1. 17
      spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/DefaultServletWebServerFactoryCustomizerTests.java

17
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/DefaultServletWebServerFactoryCustomizerTests.java

@ -46,7 +46,6 @@ import org.springframework.boot.context.properties.source.ConfigurationPropertyS @@ -46,7 +46,6 @@ import org.springframework.boot.context.properties.source.ConfigurationPropertyS
import org.springframework.boot.context.properties.source.MapConfigurationPropertySource;
import org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory;
import org.springframework.boot.web.embedded.jetty.JettyWebServer;
import org.springframework.boot.web.embedded.tomcat.TomcatContextCustomizer;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.embedded.tomcat.TomcatWebServer;
import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory;
@ -160,11 +159,9 @@ public class DefaultServletWebServerFactoryCustomizerTests { @@ -160,11 +159,9 @@ public class DefaultServletWebServerFactoryCustomizerTests {
assertThat(tomcat.getRedirectContextRoot()).isEqualTo(false);
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory();
this.customizer.customize(factory);
Context context = mock(Context.class);
for (TomcatContextCustomizer customizer : factory.getTomcatContextCustomizers()) {
customizer.customize(context);
}
verify(context).setMapperContextRootRedirectEnabled(false);
Context context = (Context) ((TomcatWebServer) factory.getWebServer()).getTomcat()
.getHost().findChildren()[0];
assertThat(context.getMapperContextRootRedirectEnabled()).isFalse();
}
@Test
@ -176,11 +173,9 @@ public class DefaultServletWebServerFactoryCustomizerTests { @@ -176,11 +173,9 @@ public class DefaultServletWebServerFactoryCustomizerTests {
assertThat(tomcat.getUseRelativeRedirects()).isTrue();
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory();
this.customizer.customize(factory);
Context context = mock(Context.class);
for (TomcatContextCustomizer customizer : factory.getTomcatContextCustomizers()) {
customizer.customize(context);
}
verify(context).setUseRelativeRedirects(true);
Context context = (Context) ((TomcatWebServer) factory.getWebServer()).getTomcat()
.getHost().findChildren()[0];
assertThat(context.getUseRelativeRedirects()).isTrue();
}
@Test

Loading…
Cancel
Save