* We expect Cache-Control: ... Date: ... Expires: ...
*/
@Test
public void testAddingOfDefaultHeadersWorks() {
Result result = Results.json();
// just a new object as dummy...
result.render(new Object());
// make sure the stuff is not set by default json method (just in
// case...)
assertNull(result.getHeaders().get(Result.CACHE_CONTROL));
assertNull(result.getHeaders().get(Result.DATE));
assertNull(result.getHeaders().get(Result.EXPIRES));
// handle result
resultHandler.handleResult(result, context);
// make sure stuff is there:
assertEquals(Result.CACHE_CONTROL_DEFAULT_NOCACHE_VALUE, result
.getHeaders().get(Result.CACHE_CONTROL));
assertNotNull(result.getHeaders().get(Result.DATE));
assertEquals(DateUtil.formatForHttpHeader(0L),
result.getHeaders().get(Result.EXPIRES));
}