use of com.github.mjeanroy.junit.servers.utils.builders.EmbeddedServerMockBuilder in project junit-servers by mjeanroy.
the class EmbeddedServerRunnerTest method it_should_get_url.
@Test
void it_should_get_url() {
final EmbeddedServer<?> server = new EmbeddedServerMockBuilder().build();
final EmbeddedServerRunner adapter = new EmbeddedServerRunner(server);
final String url = adapter.getUrl();
assertThat(url).isNotNull().isEqualTo(server.getUrl());
}
use of com.github.mjeanroy.junit.servers.utils.builders.EmbeddedServerMockBuilder in project junit-servers by mjeanroy.
the class EmbeddedServerRunnerTest method it_should_get_client_of_given_strategy.
@Test
void it_should_get_client_of_given_strategy() {
final EmbeddedServer<?> server = new EmbeddedServerMockBuilder().build();
final EmbeddedServerRunner adapter = new EmbeddedServerRunner(server);
final HttpClientStrategy strategy = HttpClientStrategy.OK_HTTP3;
final HttpClient client = adapter.getClient(strategy);
assertThat(client).isNotNull();
}
use of com.github.mjeanroy.junit.servers.utils.builders.EmbeddedServerMockBuilder in project junit-servers by mjeanroy.
the class EmbeddedServerRunnerTest method it_should_get_server_host.
@Test
void it_should_get_server_host() {
final EmbeddedServer<?> server = new EmbeddedServerMockBuilder().build();
final EmbeddedServerRunner adapter = new EmbeddedServerRunner(server);
final String host = adapter.getHost();
assertThat(host).isNotNull().isEqualTo(server.getHost());
}
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_given_strategy_custom_configuration_and_return_previous_one_with_same_configuration.
@Test
public void it_should_get_client_with_given_strategy_custom_configuration_and_return_previous_one_with_same_configuration() {
final EmbeddedServer<?> server = new EmbeddedServerMockBuilder().build();
final EmbeddedServerRunner adapter = new EmbeddedServerRunner(server);
final HttpClientStrategy strategy = HttpClientStrategy.OK_HTTP3;
final HttpClientConfiguration configuration1 = new HttpClientConfiguration.Builder().build();
final HttpClientConfiguration configuration2 = new HttpClientConfiguration.Builder().build();
final HttpClient client1 = adapter.getClient(strategy, configuration1);
final HttpClient client2 = adapter.getClient(strategy, configuration2);
assertThat(client1).isSameAs(client2);
}
use of com.github.mjeanroy.junit.servers.utils.builders.EmbeddedServerMockBuilder in project junit-servers by mjeanroy.
the class EmbeddedServerRunnerTest method it_should_get_server_port.
@Test
void it_should_get_server_port() {
final EmbeddedServer<?> server = new EmbeddedServerMockBuilder().build();
final EmbeddedServerRunner adapter = new EmbeddedServerRunner(server);
final int port = adapter.getPort();
assertThat(port).isNotNull().isEqualTo(server.getPort());
}
Aggregations