use of com.github.mjeanroy.junit.servers.servers.AbstractConfiguration in project junit-servers by mjeanroy.
the class ConfigurationAnnotationHandlerTest method it_should_set_configuration_instance.
@Test
void it_should_set_configuration_instance() {
final AbstractConfiguration configuration = new AbstractConfigurationMockBuilder().build();
final TestClassWithAnnotatedField target = new TestClassWithAnnotatedField();
final Field field = extractConfigurationField();
final AnnotationHandler handler = newConfigurationAnnotationHandler(configuration);
verifyBeforeTest(configuration, target, field, handler);
}
use of com.github.mjeanroy.junit.servers.servers.AbstractConfiguration in project junit-servers by mjeanroy.
the class ConfigurationAnnotationHandlerTest method it_should_implement_to_string.
@Test
void it_should_implement_to_string() {
final AbstractConfiguration configuration = new AbstractConfigurationMockBuilder().build();
final AnnotationHandler handler = newConfigurationAnnotationHandler(configuration);
assertThat(handler).hasToString("ConfigurationAnnotationHandler{" + "annotationKlass: interface com.github.mjeanroy.junit.servers.annotations.TestServerConfiguration, " + "configuration: MockAbstractConfiguration" + "}");
}
use of com.github.mjeanroy.junit.servers.servers.AbstractConfiguration in project junit-servers by mjeanroy.
the class AnnotationsHandlerRunnerTest method it_should_process_handlers.
@Test
void it_should_process_handlers() {
final AbstractConfiguration configuration = new AbstractConfigurationMockBuilder().build();
final EmbeddedServer<?> embeddedServer = new EmbeddedServerMockBuilder().build();
final FixtureClass target = new FixtureClass();
final AnnotationsHandlerRunner adapter = new AnnotationsHandlerRunner(embeddedServer, configuration);
verifyBeforeTest(configuration, embeddedServer, target, adapter);
verifyAfterTest(configuration, embeddedServer, target, adapter);
}
use of com.github.mjeanroy.junit.servers.servers.AbstractConfiguration in project junit-servers by mjeanroy.
the class ServersTest method it_should_return_configuration_as_result_of_method.
@Test
void it_should_return_configuration_as_result_of_method() {
final AbstractConfiguration configuration = Servers.findConfiguration(FixtureClassWithConfigurationAsMethod.class);
assertThat(configuration).isNotNull();
}
use of com.github.mjeanroy.junit.servers.servers.AbstractConfiguration in project junit-servers by mjeanroy.
the class JettyServerJunit4RunnerTest method it_should_instantiate_jetty_with_default_configuration.
@Test
void it_should_instantiate_jetty_with_default_configuration() throws Exception {
final JettyServerJunit4Runner runner = createRunner(TestClassWithConfiguration.class);
final EmbeddedServer<?> server = (EmbeddedServer<?>) readField(runner, "server", true);
final AbstractConfiguration conf = (AbstractConfiguration) readField(runner, "configuration", true);
assertThat(server).isInstanceOf(EmbeddedJetty.class);
assertThat(conf).isInstanceOf(EmbeddedJettyConfiguration.class).isNotSameAs(configuration);
}
Aggregations