public void test_Cached_Resource_Good()
throws Exception
{
WebRequest request = newMock(WebRequest.class);
checkOrder(request, false);
WebResponse response = newMock(WebResponse.class);
AssetService service = new AssetService();
service.setRequest(request);
service.setResponse(response);
URLConnection url = org.easymock.classextension.EasyMock.createMock(URLConnection.class);
expect(request.getHeader("If-Modified-Since")).andReturn("Sat, 29 Oct 1994 19:43:31 GMT");
expect(url.getLastModified()).andReturn(AssetService.CACHED_FORMAT.parse("Sat, 1 Dec 1991 19:43:31 GMT").getTime());
response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
replay();
org.easymock.classextension.EasyMock.replay(url);
assertTrue(service.cachedResource(url));