use of com.github.mjeanroy.junit.servers.jetty.tests.EmbeddedJettyConfigurationMockBuilder in project junit-servers by mjeanroy.
the class EmbeddedJettyProviderTest method it_should_instantiate_jetty_with_custom_configuration.
@Test
void it_should_instantiate_jetty_with_custom_configuration() {
final EmbeddedJettyProvider provider = new EmbeddedJettyProvider();
final EmbeddedJettyConfiguration configuration = new EmbeddedJettyConfigurationMockBuilder().build();
final EmbeddedJetty jetty = provider.instantiate(configuration);
assertThat(jetty).isNotNull();
assertThat(jetty.getConfiguration()).isNotNull().isSameAs(configuration);
}
use of com.github.mjeanroy.junit.servers.jetty.tests.EmbeddedJettyConfigurationMockBuilder in project junit-servers by mjeanroy.
the class JettyServerJunit4RuleTest method it_should_create_rule_with_server.
@Test
void it_should_create_rule_with_server() throws Throwable {
final EmbeddedJettyConfiguration config = new EmbeddedJettyConfigurationMockBuilder().build();
final EmbeddedJetty jetty = new EmbeddedJettyMockBuilder().withConfiguration(config).build();
final JettyServerJunit4Rule rule = createRule(jetty);
assertThat(rule.getServer()).isSameAs(jetty);
assertThat(rule.getScheme()).isEqualTo(jetty.getScheme());
assertThat(rule.getHost()).isEqualTo(jetty.getHost());
assertThat(rule.getPort()).isEqualTo(jetty.getPort());
assertThat(rule.getPath()).isEqualTo(jetty.getPath());
assertThat(rule.getUrl()).isEqualTo(jetty.getUrl());
verify(jetty, never()).start();
verify(jetty, never()).stop();
evaluateRule(rule);
InOrder inOrder = Mockito.inOrder(jetty);
inOrder.verify(jetty).start();
inOrder.verify(jetty).stop();
}
Aggregations