use of com.github.mjeanroy.junit.servers.client.HttpClientConfiguration in project junit-servers by mjeanroy.
the class BaseHttpClientTest method testRequestWithDefaultHeaderObject.
@Test
void testRequestWithDefaultHeaderObject() {
final String name = "X-Custom-Header";
final String value = "FooBar";
final HttpHeader header = HttpHeader.header(name, value);
final HttpClientConfiguration configuration = new HttpClientConfiguration.Builder().addDefaultHeader(header).build();
stubDefaultRequest(ENDPOINT);
testRequestHeader(createCustomClient(configuration), name, value, rq -> {
});
}
use of com.github.mjeanroy.junit.servers.client.HttpClientConfiguration in project junit-servers by mjeanroy.
the class BaseHttpClientTest method testRequestWithDefaultHeader.
@Test
void testRequestWithDefaultHeader() {
final String name = "X-Custom-Header";
final String value = "FooBar";
final HttpClientConfiguration configuration = new HttpClientConfiguration.Builder().addDefaultHeader(name, value).build();
stubDefaultRequest(ENDPOINT);
testRequestHeader(createCustomClient(configuration), name, value, rq -> {
});
}
use of com.github.mjeanroy.junit.servers.client.HttpClientConfiguration in project junit-servers by mjeanroy.
the class BaseHttpClientTest method it_should_create_client_with_custom_configuration.
@Test
void it_should_create_client_with_custom_configuration() {
final HttpClientConfiguration configuration = new HttpClientConfiguration.Builder().disableFollowRedirect().build();
final HttpClient client = createCustomClient(configuration, server);
assertThat(client).isNotNull();
final EmbeddedServer<?> server = readPrivate(client, "server");
assertThat(server).isNotNull().isSameAs(this.server);
checkInternalHttpClient(configuration, client);
}
Aggregations