use of com.github.mjeanroy.junit.servers.utils.builders.EmbeddedServerMockBuilder in project junit-servers by mjeanroy.
the class ServerRuleTest method it_should_destroy_http_client_when_rule_stop.
@Test
void it_should_destroy_http_client_when_rule_stop() {
final EmbeddedServer<?> server = new EmbeddedServerMockBuilder().build();
final ServerRule rule = createRule(server);
final HttpClient client = rule.getClient();
assertThat(client).isNotNull();
assertThat(client.isDestroyed()).isFalse();
rule.after();
assertThat(client.isDestroyed()).isTrue();
}
use of com.github.mjeanroy.junit.servers.utils.builders.EmbeddedServerMockBuilder in project junit-servers by mjeanroy.
the class ServerRuleTest method it_should_get_http_client.
@Test
void it_should_get_http_client() {
final EmbeddedServer<?> server = new EmbeddedServerMockBuilder().build();
final ServerRule rule = createRule(server);
final HttpClient client = rule.getClient();
assertThat(client).isNotNull();
assertThat(client).isSameAs(rule.getClient());
assertThat(client.isDestroyed()).isFalse();
}
use of com.github.mjeanroy.junit.servers.utils.builders.EmbeddedServerMockBuilder in project junit-servers by mjeanroy.
the class ServerRuleTest method it_should_start_server.
@Test
void it_should_start_server() {
final EmbeddedServer<?> server = new EmbeddedServerMockBuilder().build();
final ServerRule rule = createRule(server);
rule.before();
verify(server).start();
}
use of com.github.mjeanroy.junit.servers.utils.builders.EmbeddedServerMockBuilder in project junit-servers by mjeanroy.
the class HttpClientParameterResolverFunctionTest method setUp.
@BeforeEach
void setUp() {
resolver = HttpClientParameterResolverFunction.getInstance();
adapter = new EmbeddedServerRunner(new EmbeddedServerMockBuilder().build());
}
use of com.github.mjeanroy.junit.servers.utils.builders.EmbeddedServerMockBuilder in project junit-servers by mjeanroy.
the class EmbeddedServerRunnerTest method it_should_get_server.
@Test
void it_should_get_server() {
final EmbeddedServer<?> server = new EmbeddedServerMockBuilder().build();
final EmbeddedServerRunner adapter = new EmbeddedServerRunner(server);
final EmbeddedServer<?> result = adapter.getServer();
assertThat(result).isNotNull().isSameAs(server);
}
Aggregations