@Test public void dateHeaderGMT() { Map<String, List<String>> headers = new HashMap<>(); headers.put("Date", Collections.singletonList("Fri, 27 Jul 2012 17:21:03 GMT")); HttpResponse res = new HttpResponse(200, headers); Instant expected = Instant.ofEpochMilli(1343409663000L); Assertions.assertEquals(expected, res.dateHeader("Date")); }
@Test public void dateHeaderNull() { Map<String, List<String>> headers = new HashMap<>(); HttpResponse res = new HttpResponse(200, headers); Assertions.assertNull(res.dateHeader("Date")); }