@Test
  public void malformedDateHeader() throws Exception {
    handler = new RequestHandler() {

      @Override
      public void handle(Request request, HttpServletResponse response) {
        response.setStatus(HTTP_OK);
        response.setHeader("malformed", "not a date");
      }
    };
    assertEquals(1234L, get(url).dateHeader("malformed", 1234L));
  }
Verify getting date header with default value

@throws Exception
lib/src/test/java/com/github/kevinsawicki/http/HttpRequestTest.java