|
|
@ -263,6 +263,15 @@ public abstract class AbstractServletWebServerFactoryTests {
|
|
|
|
assertThat(getResponse(getLocalUrl("/say/hello"))).isEqualTo("Hello World");
|
|
|
|
assertThat(getResponse(getLocalUrl("/say/hello"))).isEqualTo("Hello World");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
public void contextPathIsLoggedOnStartup() {
|
|
|
|
|
|
|
|
AbstractServletWebServerFactory factory = getFactory();
|
|
|
|
|
|
|
|
factory.setContextPath("/custom");
|
|
|
|
|
|
|
|
this.webServer = factory.getWebServer(exampleServletRegistration());
|
|
|
|
|
|
|
|
this.webServer.start();
|
|
|
|
|
|
|
|
assertThat(this.output.toString()).containsOnlyOnce("with context path '/custom'");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void contextPathMustStartWithSlash() throws Exception {
|
|
|
|
public void contextPathMustStartWithSlash() throws Exception {
|
|
|
|
this.thrown.expect(IllegalArgumentException.class);
|
|
|
|
this.thrown.expect(IllegalArgumentException.class);
|
|
|
|