### Question:
IfModifiedSinceProcessor implements JsProcessor { public boolean process(JsRequest request, JsResponseBuilder builder) { if (request.isInCache() && request.getJsUri().getStatus() == UriStatus.VALID_VERSIONED) { builder.setStatusCode(HttpServletResponse.SC_NOT_MODIFIED); builder.setCacheTtlSecs(versionedMaxAge); return false; } return true; }  @Inject(optional=true) void setVersionedMaxAge(@Named("shindig.jscontent.versioned.maxage") Integer maxAge); boolean process(JsRequest request, JsResponseBuilder builder); static final int DEFAULT_VERSIONED_MAXAGE; }### Answer:
@Test public void testDoesNothingAndContinuesProcessingWhenHeaderIsAbsent() throws Exception { EasyMock.expect(request.isInCache()).andReturn(false); control.replay(); assertTrue(processor.process(request, response)); control.verify(); }
@Test public void testDoesNothingAndContinuesProcessingWhenNotVersioned() throws Exception { EasyMock.expect(request.isInCache()).andReturn(true); EasyMock.expect(request.getJsUri()).andReturn(jsUri); EasyMock.expect(jsUri.getStatus()).andReturn(UriStatus.VALID_UNVERSIONED); control.replay(); assertTrue(processor.process(request, response)); control.verify(); }
@Test public void testReturnsNotModifiedAndStopsProcessingWithHeaderAndVersion() throws Exception { EasyMock.expect(request.isInCache()).andReturn(true); EasyMock.expect(request.getJsUri()).andReturn(jsUri); EasyMock.expect(jsUri.getStatus()).andReturn(UriStatus.VALID_VERSIONED); control.replay(); assertFalse(processor.process(request, response)); assertEquals(HttpServletResponse.SC_NOT_MODIFIED, response.getStatusCode()); control.verify(); }