Search in sources :

Example 6 with AbstractConfigurationMockBuilder

use of com.github.mjeanroy.junit.servers.utils.builders.AbstractConfigurationMockBuilder in project junit-servers by mjeanroy.

the class AnnotationsHandlerRuleTest 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 AnnotationsHandlerRule rule = new AnnotationsHandlerRule(target, embeddedServer, configuration);
    verifyBeforeTest(configuration, embeddedServer, target, rule);
    verifyAfterTest(configuration, embeddedServer, target, rule);
}
Also used : AbstractConfiguration(com.github.mjeanroy.junit.servers.servers.AbstractConfiguration) AbstractConfigurationMockBuilder(com.github.mjeanroy.junit.servers.utils.builders.AbstractConfigurationMockBuilder) FixtureClass(com.github.mjeanroy.junit.servers.utils.fixtures.FixtureClass) EmbeddedServerMockBuilder(com.github.mjeanroy.junit.servers.utils.builders.EmbeddedServerMockBuilder) Test(org.junit.jupiter.api.Test)

Example 7 with AbstractConfigurationMockBuilder

use of com.github.mjeanroy.junit.servers.utils.builders.AbstractConfigurationMockBuilder in project junit-servers by mjeanroy.

the class AnnotationsHandlerRunnerTest 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 AnnotationsHandlerRunner adapter = new AnnotationsHandlerRunner(embeddedServer, configuration);
    assertThat(adapter).hasToString("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" + "}" + "]" + "}");
}
Also used : AbstractConfiguration(com.github.mjeanroy.junit.servers.servers.AbstractConfiguration) AbstractConfigurationMockBuilder(com.github.mjeanroy.junit.servers.utils.builders.AbstractConfigurationMockBuilder) EmbeddedServerMockBuilder(com.github.mjeanroy.junit.servers.utils.builders.EmbeddedServerMockBuilder) Test(org.junit.jupiter.api.Test)

Aggregations

AbstractConfiguration (com.github.mjeanroy.junit.servers.servers.AbstractConfiguration)7 AbstractConfigurationMockBuilder (com.github.mjeanroy.junit.servers.utils.builders.AbstractConfigurationMockBuilder)7 Test (org.junit.jupiter.api.Test)7 EmbeddedServerMockBuilder (com.github.mjeanroy.junit.servers.utils.builders.EmbeddedServerMockBuilder)4 ConfigurationAnnotationHandler.newConfigurationAnnotationHandler (com.github.mjeanroy.junit.servers.engine.ConfigurationAnnotationHandler.newConfigurationAnnotationHandler)3 FixtureClass (com.github.mjeanroy.junit.servers.utils.fixtures.FixtureClass)3 Fields.getPrivateField (com.github.mjeanroy.junit.servers.utils.commons.Fields.getPrivateField)2 Field (java.lang.reflect.Field)2 Annotation (java.lang.annotation.Annotation)1