use of org.minijax.test.MockHttpServletRequest in project minijax by minijax.
the class HttpHeadersTest method testContentLengthMissing.
@Test
public void testContentLengthMissing() {
final MultivaluedMap<String, String> headers = new MultivaluedHashMap<>();
final MockHttpServletRequest request = new MockHttpServletRequest("GET", URI.create("/"), headers, null, null);
final MinijaxHttpHeaders httpHeaders = new MinijaxHttpHeaders(request);
assertEquals(-1, httpHeaders.getLength());
}
use of org.minijax.test.MockHttpServletRequest in project minijax by minijax.
the class HttpHeadersTest method testContentLengthMalformed.
@Test
public void testContentLengthMalformed() {
final MultivaluedMap<String, String> headers = new MultivaluedHashMap<>();
headers.add("Content-Length", "x");
final MockHttpServletRequest request = new MockHttpServletRequest("GET", URI.create("/"), headers, null, null);
final MinijaxHttpHeaders httpHeaders = new MinijaxHttpHeaders(request);
assertEquals(-1, httpHeaders.getLength());
}
use of org.minijax.test.MockHttpServletRequest in project minijax by minijax.
the class HttpHeadersTest method testDate.
@Test(expected = UnsupportedOperationException.class)
public void testDate() {
final MultivaluedMap<String, String> headers = new MultivaluedHashMap<>();
final MockHttpServletRequest request = new MockHttpServletRequest("GET", URI.create("/"), headers, null, null);
final MinijaxHttpHeaders httpHeaders = new MinijaxHttpHeaders(request);
httpHeaders.getDate();
}
Aggregations