private CacheItem putAndGet(HTTPRequest request) { HTTPResponse response = new HTTPResponse(null, Status.OK, new Headers()); response = storage.insert(REQUEST, response); response.consume(); assertEquals(1, storage.size()); return storage.get(request); }
@Test public void testPutCacheItem() { HTTPResponse response = new HTTPResponse(null, Status.OK, new Headers()); response = storage.insert(REQUEST, response); response.consume(); assertEquals(1, storage.size()); }
@Test public void testInvalidate() { HTTPResponse response = new HTTPResponse(null, Status.OK, new Headers()); URI requestURI = URI.create("foo"); HTTPResponse res = storage.insert(REQUEST, response); res.consume(); assertEquals(1, storage.size()); storage.invalidate(requestURI); assertEquals(0, storage.size()); }