Search in sources :

Example 6 with EmbeddedServer

use of com.github.mjeanroy.junit.servers.servers.EmbeddedServer in project junit-servers by mjeanroy.

the class JunitServerRunnerTest method it_should_instantiate_jetty_with_default_configuration.

@Test
void it_should_instantiate_jetty_with_default_configuration() throws Exception {
    final JunitServerRunner runner = new JunitServerRunner(TestClassWithInjectedConfiguration.class);
    final EmbeddedServer<?> server = (EmbeddedServer<?>) readField(runner, "server", true);
    final AbstractConfiguration conf = (AbstractConfiguration) readField(runner, "configuration", true);
    assertThat(server).isInstanceOf(EmbeddedJetty.class);
    assertThat(conf).isNotSameAs(configuration).isEqualTo(configuration);
}
Also used : AbstractConfiguration(com.github.mjeanroy.junit.servers.servers.AbstractConfiguration) EmbeddedServer(com.github.mjeanroy.junit.servers.servers.EmbeddedServer) Test(org.junit.jupiter.api.Test)

Example 7 with EmbeddedServer

use of com.github.mjeanroy.junit.servers.servers.EmbeddedServer in project junit-servers by mjeanroy.

the class JunitServerRunnerTest method it_should_instantiate_tomcat_with_default_configuration.

@Test
void it_should_instantiate_tomcat_with_default_configuration() throws Exception {
    final JunitServerRunner runner = new JunitServerRunner(TestClassWithInjectedConfiguration.class);
    final EmbeddedServer<?> server = (EmbeddedServer<?>) readField(runner, "server", true);
    final AbstractConfiguration conf = (AbstractConfiguration) readField(runner, "configuration", true);
    assertThat(server).isInstanceOf(EmbeddedTomcat.class);
    assertThat(conf).isNotSameAs(configuration).isEqualTo(configuration);
}
Also used : AbstractConfiguration(com.github.mjeanroy.junit.servers.servers.AbstractConfiguration) EmbeddedServer(com.github.mjeanroy.junit.servers.servers.EmbeddedServer) Test(org.junit.jupiter.api.Test)

Example 8 with EmbeddedServer

use of com.github.mjeanroy.junit.servers.servers.EmbeddedServer in project junit-servers by mjeanroy.

the class JunitServerRunnerTest method it_should_instantiate_tomcat_with_configuration.

@Test
void it_should_instantiate_tomcat_with_configuration() throws Exception {
    final JunitServerRunner runner = new JunitServerRunner(TestClassWithConfigurationMethod.class);
    final EmbeddedServer<?> server = (EmbeddedServer<?>) readField(runner, "server", true);
    final AbstractConfiguration conf = (AbstractConfiguration) readField(runner, "configuration", true);
    assertThat(server).isInstanceOf(EmbeddedTomcat.class);
    assertThat(conf).isSameAs(configuration);
}
Also used : AbstractConfiguration(com.github.mjeanroy.junit.servers.servers.AbstractConfiguration) EmbeddedServer(com.github.mjeanroy.junit.servers.servers.EmbeddedServer) Test(org.junit.jupiter.api.Test)

Aggregations

AbstractConfiguration (com.github.mjeanroy.junit.servers.servers.AbstractConfiguration)8 EmbeddedServer (com.github.mjeanroy.junit.servers.servers.EmbeddedServer)8 Test (org.junit.jupiter.api.Test)8 EmbeddedJettyConfiguration (com.github.mjeanroy.junit.servers.jetty.EmbeddedJettyConfiguration)2 EmbeddedTomcatConfiguration (com.github.mjeanroy.junit.servers.tomcat.EmbeddedTomcatConfiguration)2