use of com.github.mjeanroy.junit.servers.utils.builders.AbstractConfigurationMockBuilder 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.utils.builders.AbstractConfigurationMockBuilder 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.utils.builders.AbstractConfigurationMockBuilder 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.utils.builders.AbstractConfigurationMockBuilder in project junit-servers by mjeanroy.
the class ConfigurationAnnotationHandlerTest method it_should_support_server_annotation.
@Test
void it_should_support_server_annotation() {
final AbstractConfiguration configuration = new AbstractConfigurationMockBuilder().build();
final AnnotationHandler handler = newConfigurationAnnotationHandler(configuration);
final Field field = extractConfigurationField();
final Annotation annotation = readAnnotation(field);
assertThat(handler.support(annotation)).isTrue();
}
use of com.github.mjeanroy.junit.servers.utils.builders.AbstractConfigurationMockBuilder in project junit-servers by mjeanroy.
the class AnnotationsHandlerRuleTest method it_should_implement_to_string.
@Test
void it_should_implement_to_string() {
final AbstractConfiguration configuration = new AbstractConfigurationMockBuilder().build();
final EmbeddedServer<?> embeddedServer = new EmbeddedServerMockBuilder().build();
final FixtureClass target = new FixtureClass();
final AnnotationsHandlerRule rule = new AnnotationsHandlerRule(target, embeddedServer, configuration);
assertThat(rule).hasToString("AnnotationsHandlerRule{" + "target: FixtureClass, " + "annotationHandlers: AnnotationsHandlerRunner{" + "handlers: [" + "ServerAnnotationHandler{" + "annotationKlass: interface com.github.mjeanroy.junit.servers.annotations.TestServer, " + "server: MockEmbeddedServer" + "}, " + "ConfigurationAnnotationHandler{" + "annotationKlass: interface com.github.mjeanroy.junit.servers.annotations.TestServerConfiguration, " + "configuration: MockAbstractConfiguration" + "}, " + "HttpClientAnnotationHandler{" + "annotationKlass: interface com.github.mjeanroy.junit.servers.annotations.TestHttpClient, " + "server: MockEmbeddedServer" + "}" + "]" + "}" + "}");
}
Aggregations