use of com.github.mjeanroy.junit.servers.utils.builders.EmbeddedServerMockBuilder in project junit-servers by mjeanroy.
the class BaseHttpClientTest method setUp.
@BeforeEach
void setUp(WireMockServer wireMockServer) {
scheme = "http";
host = "localhost";
port = wireMockServer.port();
server = new EmbeddedServerMockBuilder().withScheme(scheme).withHost(host).withPort(port).build();
}
use of com.github.mjeanroy.junit.servers.utils.builders.EmbeddedServerMockBuilder in project junit-servers by mjeanroy.
the class EmbeddedServerRunnerTest method it_should_get_client_with_custom_configuration.
@Test
public void it_should_get_client_with_custom_configuration() {
final EmbeddedServer<?> server = new EmbeddedServerMockBuilder().build();
final EmbeddedServerRunner adapter = new EmbeddedServerRunner(server);
final HttpClientConfiguration configuration = new HttpClientConfiguration.Builder().disableFollowRedirect().build();
final HttpClient client = adapter.getClient(configuration);
assertThat(client).isNotNull();
assertThat(client.getConfiguration()).isSameAs(configuration);
}
use of com.github.mjeanroy.junit.servers.utils.builders.EmbeddedServerMockBuilder in project junit-servers by mjeanroy.
the class EmbeddedServerRunnerTest method it_should_get_server_path.
@Test
void it_should_get_server_path() {
final EmbeddedServer<?> server = new EmbeddedServerMockBuilder().build();
final EmbeddedServerRunner adapter = new EmbeddedServerRunner(server);
final String path = adapter.getPath();
assertThat(path).isNotNull().isEqualTo(server.getPath());
}
use of com.github.mjeanroy.junit.servers.utils.builders.EmbeddedServerMockBuilder in project junit-servers by mjeanroy.
the class EmbeddedServerRunnerTest method it_should_restart_server.
@Test
void it_should_restart_server() {
final EmbeddedServer<?> server = new EmbeddedServerMockBuilder().build();
final EmbeddedServerRunner adapter = new EmbeddedServerRunner(server);
adapter.restart();
verify(server).restart();
}
use of com.github.mjeanroy.junit.servers.utils.builders.EmbeddedServerMockBuilder in project junit-servers by mjeanroy.
the class EmbeddedServerRunnerTest method it_should_stop_server_after_test.
@Test
void it_should_stop_server_after_test() {
final EmbeddedServer<?> server = new EmbeddedServerMockBuilder().build();
final EmbeddedServerRunner adapter = new EmbeddedServerRunner(server);
adapter.afterAll();
verify(server).stop();
}
Aggregations