use of com.github.mjeanroy.junit.servers.utils.builders.EmbeddedServerMockBuilder in project junit-servers by mjeanroy.
the class ConfigurationParameterResolverFunctionTest method setUp.
@BeforeEach
void setUp() {
resolver = ConfigurationResolverFunction.getInstance();
server = new EmbeddedServerMockBuilder().build();
adapter = new EmbeddedServerRunner(server);
}
use of com.github.mjeanroy.junit.servers.utils.builders.EmbeddedServerMockBuilder in project junit-servers by mjeanroy.
the class EmbeddedServerParameterResolverFunctionTest method setUp.
@BeforeEach
void setUp() {
resolver = EmbeddedServerParameterResolverFunction.getInstance();
server = new EmbeddedServerMockBuilder().build();
adapter = new EmbeddedServerRunner(server);
}
use of com.github.mjeanroy.junit.servers.utils.builders.EmbeddedServerMockBuilder in project junit-servers by mjeanroy.
the class JunitServerExtensionTest method it_should_initialize_extension_with_given_server_and_start_given_server_before_all_tests.
@Test
void it_should_initialize_extension_with_given_server_and_start_given_server_before_all_tests() {
final EmbeddedServer<?> server = new EmbeddedServerMockBuilder().build();
final JunitServerExtension extension = new JunitServerExtension(server);
final FixtureClass testInstance = new FixtureClass();
final FakeExtensionContext context = new FakeExtensionContext(testInstance);
extension.beforeAll(context);
final FakeStore store = context.getSingleStore();
final EmbeddedServerRunner serverAdapter = store.get("serverAdapter", EmbeddedServerRunner.class);
assertThat(serverAdapter).isNotNull();
assertThat(serverAdapter.getServer()).isSameAs(server);
assertThat(serverAdapter.getServer().isStarted()).isTrue();
}
use of com.github.mjeanroy.junit.servers.utils.builders.EmbeddedServerMockBuilder in project junit-servers by mjeanroy.
the class NingAsyncHttpClientTest method it_should_implement_to_string.
@Test
void it_should_implement_to_string() {
final EmbeddedServer<?> server = new EmbeddedServerMockBuilder().build();
final HttpClient client = createDefaultClient(server);
final AsyncHttpClient internalClient = readPrivate(client, "client");
assertThat(client).hasToString("NingAsyncHttpClient{" + "configuration: HttpClientConfiguration{" + "followRedirect: true, " + "defaultHeaders: {}, " + "defaultCookies: []" + "}, " + "server: MockEmbeddedServer, " + "client: " + internalClient.toString() + "}");
}
use of com.github.mjeanroy.junit.servers.utils.builders.EmbeddedServerMockBuilder in project junit-servers by mjeanroy.
the class ApacheHttpClientTest method it_should_implement_to_string.
@Test
void it_should_implement_to_string() {
final EmbeddedServer<?> server = new EmbeddedServerMockBuilder().build();
final HttpClient client = createDefaultClient(server);
final CloseableHttpClient internalClient = readPrivate(client, "client");
assertThat(client).hasToString("ApacheHttpClient{" + "configuration: HttpClientConfiguration{" + "followRedirect: true, " + "defaultHeaders: {}, " + "defaultCookies: []" + "}, " + "server: MockEmbeddedServer, " + "client: " + internalClient.toString() + ", " + "destroyed: false" + "}");
}
Aggregations