use of org.springframework.boot.devtools.remote.server.DispatcherFilter in project spring-boot by spring-projects.
the class RemoteDevToolsAutoConfigurationTests method invokeRestartWithDefaultSetup.
@Test
void invokeRestartWithDefaultSetup() throws Exception {
this.context = getContext(() -> loadContext("spring.devtools.remote.secret:supersecret"));
DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
this.request.setRequestURI(DEFAULT_CONTEXT_PATH + "/restart");
this.request.addHeader(DEFAULT_SECRET_HEADER_NAME, "supersecret");
filter.doFilter(this.request, this.response, this.chain);
assertRestartInvoked(true);
}
use of org.springframework.boot.devtools.remote.server.DispatcherFilter in project spring-boot by spring-projects.
the class RemoteDevToolsAutoConfigurationTests method devToolsHealthReturns200.
@Test
void devToolsHealthReturns200() throws Exception {
this.context = getContext(() -> loadContext("spring.devtools.remote.secret:supersecret"));
DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
this.request.setRequestURI(DEFAULT_CONTEXT_PATH);
this.request.addHeader(DEFAULT_SECRET_HEADER_NAME, "supersecret");
this.response.setStatus(500);
filter.doFilter(this.request, this.response, this.chain);
assertThat(this.response.getStatus()).isEqualTo(200);
}
use of org.springframework.boot.devtools.remote.server.DispatcherFilter in project spring-boot by spring-projects.
the class RemoteDevToolsAutoConfigurationTests method ignoresUnmappedUrl.
@Test
void ignoresUnmappedUrl() throws Exception {
this.context = getContext(() -> loadContext("spring.devtools.remote.secret:supersecret"));
DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
this.request.setRequestURI("/restart");
this.request.addHeader(DEFAULT_SECRET_HEADER_NAME, "supersecret");
filter.doFilter(this.request, this.response, this.chain);
assertRestartInvoked(false);
}
use of org.springframework.boot.devtools.remote.server.DispatcherFilter in project spring-boot by spring-projects.
the class RemoteDevToolsAutoConfigurationTests method invokeTunnelWithDefaultSetup.
@Test
public void invokeTunnelWithDefaultSetup() throws Exception {
loadContext("spring.devtools.remote.secret:supersecret");
DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
this.request.setRequestURI(DEFAULT_CONTEXT_PATH + "/debug");
this.request.addHeader(DEFAULT_SECRET_HEADER_NAME, "supersecret");
filter.doFilter(this.request, this.response, this.chain);
assertTunnelInvoked(true);
}
use of org.springframework.boot.devtools.remote.server.DispatcherFilter in project spring-boot by spring-projects.
the class RemoteDevToolsAutoConfigurationTests method devToolsHealthWithCustomServerContextPathReturns200.
@Test
void devToolsHealthWithCustomServerContextPathReturns200() throws Exception {
this.context = getContext(() -> loadContext("spring.devtools.remote.secret:supersecret", "server.servlet.context-path:/test"));
DispatcherFilter filter = this.context.getBean(DispatcherFilter.class);
this.request.setRequestURI("/test" + DEFAULT_CONTEXT_PATH);
this.request.addHeader(DEFAULT_SECRET_HEADER_NAME, "supersecret");
this.response.setStatus(500);
filter.doFilter(this.request, this.response, this.chain);
assertThat(this.response.getStatus()).isEqualTo(200);
}
Aggregations