use of com.github.mjeanroy.junit.servers.client.HttpHeader in project junit-servers by mjeanroy.
the class AbstractHttpResponseImplTest method it_should_get_last_modified_header.
@Test
void it_should_get_last_modified_header() {
final String name = "Last-Modified";
final String value = "Wed, 21 Oct 2015 07:28:00 GMT";
final V response = createHttpResponseWithHeader(name, value);
final HttpHeader header = response.getLastModified();
assertHeader(header, name, value);
}
use of com.github.mjeanroy.junit.servers.client.HttpHeader in project junit-servers by mjeanroy.
the class AbstractHttpResponseImplTest method it_should_get_header.
@Test
void it_should_get_header() {
final HttpHeader h1 = HttpHeader.header("Content-Type", "text/html; charset=utf-8");
final HttpHeader h2 = HttpHeader.header("Status", "200");
final V response = createHttpResponseWithHeaders(h1, h2);
final HttpHeader header = response.getHeader(h1.getName());
assertHeader(header, h1.getName(), h1.getValues());
}
use of com.github.mjeanroy.junit.servers.client.HttpHeader in project junit-servers by mjeanroy.
the class AbstractHttpResponseImplTest method it_should_get_x_xss_protection_header.
@Test
void it_should_get_x_xss_protection_header() {
final String name = "X-XSS-Protection";
final String value = "0";
final V response = createHttpResponseWithHeader(name, value);
final HttpHeader header = response.getXXSSProtection();
assertHeader(header, name, value);
}
use of com.github.mjeanroy.junit.servers.client.HttpHeader in project junit-servers by mjeanroy.
the class AbstractHttpResponseImplTest method it_should_get_x_webkit_csp_header.
@Test
void it_should_get_x_webkit_csp_header() {
final String name = "X-Webkit-CSP";
final String value = "default-src 'self'";
final V response = createHttpResponseWithHeader(name, value);
final HttpHeader header = response.getXWebkitCSP();
assertHeader(header, name, value);
}
use of com.github.mjeanroy.junit.servers.client.HttpHeader in project junit-servers by mjeanroy.
the class AbstractHttpResponseImplTest method it_should_check_if_response_contains_header_case_insensitively.
@Test
void it_should_check_if_response_contains_header_case_insensitively() {
final HttpHeader h1 = HttpHeader.header("Content-Type", "text/html; charset=utf-8");
final HttpHeader h2 = HttpHeader.header("Status", "200");
final V response = createHttpResponseWithHeaders(h1, h2);
assertThat(response.containsHeader(h1.getName())).isTrue();
assertThat(response.containsHeader(h1.getName().toUpperCase())).isTrue();
assertThat(response.containsHeader(h1.getName().toLowerCase())).isTrue();
}
Aggregations