Search in sources :

Example 1 with ConfigurableServletWebServerFactory

use of cn.taketoday.framework.web.servlet.server.ConfigurableServletWebServerFactory in project today-infrastructure by TAKETODAY.

the class ServletWebServerFactoryCustomizerTests method testCustomizeSsl.

@Test
void testCustomizeSsl() {
    ConfigurableServletWebServerFactory factory = mock(ConfigurableServletWebServerFactory.class);
    Ssl ssl = mock(Ssl.class);
    this.properties.setSsl(ssl);
    this.customizer.customize(factory);
    then(factory).should().setSsl(ssl);
}
Also used : ConfigurableServletWebServerFactory(cn.taketoday.framework.web.servlet.server.ConfigurableServletWebServerFactory) Ssl(cn.taketoday.framework.web.server.Ssl) Test(org.junit.jupiter.api.Test)

Example 2 with ConfigurableServletWebServerFactory

use of cn.taketoday.framework.web.servlet.server.ConfigurableServletWebServerFactory in project today-infrastructure by TAKETODAY.

the class ServletWebServerFactoryCustomizerTests method testCustomizeJsp.

@Test
void testCustomizeJsp() {
    ConfigurableServletWebServerFactory factory = mock(ConfigurableServletWebServerFactory.class);
    this.customizer.customize(factory);
    then(factory).should().setJsp(any(Jsp.class));
}
Also used : ConfigurableServletWebServerFactory(cn.taketoday.framework.web.servlet.server.ConfigurableServletWebServerFactory) Jsp(cn.taketoday.framework.web.servlet.server.Jsp) Test(org.junit.jupiter.api.Test)

Example 3 with ConfigurableServletWebServerFactory

use of cn.taketoday.framework.web.servlet.server.ConfigurableServletWebServerFactory in project today-infrastructure by TAKETODAY.

the class ServletWebServerFactoryCustomizerTests method testDefaultDisplayName.

@Test
void testDefaultDisplayName() {
    ConfigurableServletWebServerFactory factory = mock(ConfigurableServletWebServerFactory.class);
    this.customizer.customize(factory);
    then(factory).should().setDisplayName("application");
}
Also used : ConfigurableServletWebServerFactory(cn.taketoday.framework.web.servlet.server.ConfigurableServletWebServerFactory) Test(org.junit.jupiter.api.Test)

Example 4 with ConfigurableServletWebServerFactory

use of cn.taketoday.framework.web.servlet.server.ConfigurableServletWebServerFactory in project today-infrastructure by TAKETODAY.

the class ServletWebServerFactoryCustomizerTests method whenShutdownPropertyIsSetThenShutdownIsCustomized.

@Test
void whenShutdownPropertyIsSetThenShutdownIsCustomized() {
    Map<String, String> map = new HashMap<>();
    map.put("server.shutdown", "graceful");
    bindProperties(map);
    ConfigurableServletWebServerFactory factory = mock(ConfigurableServletWebServerFactory.class);
    this.customizer.customize(factory);
    ArgumentCaptor<Shutdown> shutdownCaptor = ArgumentCaptor.forClass(Shutdown.class);
    then(factory).should().setShutdown(shutdownCaptor.capture());
    assertThat(shutdownCaptor.getValue()).isEqualTo(Shutdown.GRACEFUL);
}
Also used : ConfigurableServletWebServerFactory(cn.taketoday.framework.web.servlet.server.ConfigurableServletWebServerFactory) Shutdown(cn.taketoday.framework.web.server.Shutdown) HashMap(java.util.HashMap) Test(org.junit.jupiter.api.Test)

Example 5 with ConfigurableServletWebServerFactory

use of cn.taketoday.framework.web.servlet.server.ConfigurableServletWebServerFactory in project today-infrastructure by TAKETODAY.

the class ServletWebServerFactoryCustomizerTests method testCustomizeDefaultServlet.

@Test
void testCustomizeDefaultServlet() {
    ConfigurableServletWebServerFactory factory = mock(ConfigurableServletWebServerFactory.class);
    this.properties.getServlet().setRegisterDefaultServlet(false);
    this.customizer.customize(factory);
    then(factory).should().setRegisterDefaultServlet(false);
}
Also used : ConfigurableServletWebServerFactory(cn.taketoday.framework.web.servlet.server.ConfigurableServletWebServerFactory) Test(org.junit.jupiter.api.Test)

Aggregations

ConfigurableServletWebServerFactory (cn.taketoday.framework.web.servlet.server.ConfigurableServletWebServerFactory)20 Test (org.junit.jupiter.api.Test)20 HashMap (java.util.HashMap)8 Shutdown (cn.taketoday.framework.web.server.Shutdown)2 Ssl (cn.taketoday.framework.web.server.Ssl)2 Jsp (cn.taketoday.framework.web.servlet.server.Jsp)2 Session (cn.taketoday.framework.web.servlet.server.Session)2 Session (cn.taketoday.framework.web.session.Session)2 File (java.io.File)2 Cookie (cn.taketoday.framework.web.session.Cookie)1