use of cn.taketoday.test.web.servlet.ExampleServlet in project today-infrastructure by TAKETODAY.
the class UndertowServletWebServerFactoryTests method errorPage404.
@Test
void errorPage404() throws Exception {
AbstractServletWebServerFactory factory = getFactory();
factory.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/hello"));
this.webServer = factory.getWebServer(new ServletRegistrationBean<>(new ExampleServlet(), "/hello"));
this.webServer.start();
Assertions.assertThat(getResponse(getLocalUrl("/hello"))).isEqualTo("Hello World");
Assertions.assertThat(getResponse(getLocalUrl("/not-found"))).isEqualTo("Hello World");
}
Aggregations