use of com.github.mjeanroy.junit.servers.utils.builders.EmbeddedServerMockBuilder in project junit-servers by mjeanroy.
the class ServerAnnotationHandlerTest method it_should_set_server_instance.
@Test
void it_should_set_server_instance() {
final EmbeddedServer<?> server = new EmbeddedServerMockBuilder().build();
final Field field = extractServerField();
final TestClassWithAnnotatedField target = new TestClassWithAnnotatedField();
final AnnotationHandler handler = newServerAnnotationHandler(server);
verifyBeforeTest(server, field, target, handler);
}
use of com.github.mjeanroy.junit.servers.utils.builders.EmbeddedServerMockBuilder in project junit-servers by mjeanroy.
the class ServerAnnotationHandlerTest method it_should_implement_to_string.
@Test
void it_should_implement_to_string() {
final EmbeddedServer<?> server = new EmbeddedServerMockBuilder().build();
final AnnotationHandler handler = newServerAnnotationHandler(server);
assertThat(handler).hasToString("ServerAnnotationHandler{" + "annotationKlass: interface com.github.mjeanroy.junit.servers.annotations.TestServer, " + "server: MockEmbeddedServer" + "}");
}
use of com.github.mjeanroy.junit.servers.utils.builders.EmbeddedServerMockBuilder in project junit-servers by mjeanroy.
the class ServerRuleTest method it_should_stop_server.
@Test
void it_should_stop_server() {
final EmbeddedServer<?> server = new EmbeddedServerMockBuilder().build();
final ServerRule rule = createRule(server);
rule.after();
verify(server).stop();
}
use of com.github.mjeanroy.junit.servers.utils.builders.EmbeddedServerMockBuilder in project junit-servers by mjeanroy.
the class ServerRuleTest method it_should_get_server.
@Test
void it_should_get_server() {
final EmbeddedServer<?> server = new EmbeddedServerMockBuilder().build();
final ServerRule rule = createRule(server);
final EmbeddedServer<?> result = rule.getServer();
assertThat(result).isSameAs(server);
}
use of com.github.mjeanroy.junit.servers.utils.builders.EmbeddedServerMockBuilder in project junit-servers by mjeanroy.
the class ServerRuleTest method it_should_implement_to_string.
@Test
void it_should_implement_to_string() {
final EmbeddedServer<?> server = new EmbeddedServerMockBuilder().build();
final ServerRule rule = createRule(server);
assertThat(rule).hasToString("ServerRule{" + "adapter: EmbeddedServerRunner{" + "server: MockEmbeddedServer, " + "clients: {}" + "}" + "}");
}
Aggregations