DeltaHandler { public void handle(final HttpServerRequest request, Router router) { Logger log = RequestLoggerFactory.getLogger(DeltaHandler.class, request); if (isDeltaPUTRequest(request)) { handleResourcePUT(request, router, log); } if (isDeltaGETRequest(request)) { String updateId = extractStringDeltaParameter(request, log); if (updateId != null) { handleCollectionGET(request, updateId, log); } } } DeltaHandler(RedisClient redisClient, HttpClient httpClient); boolean isDeltaRequest(HttpServerRequest request); void handle(final HttpServerRequest request, Router router);  }
@Test public void testDeltaNoExpiry() { DeltaHandler deltaHandler = new DeltaHandler(redisClient, null); deltaHandler.handle(request, router); verify(redisClient, times(1)).set(eq("delta:resources:a:b:c"), eq("555"), any()); verify(redisClient, never()).setex(any(), anyLong(), any(), any()); }
@Test public void testDeltaWithExpiry() { requestHeaders.add("x-expire-after", "123"); DeltaHandler deltaHandler = new DeltaHandler(redisClient, null); deltaHandler.handle(request, router); verify(redisClient, times(1)).setex(eq("delta:resources:a:b:c"), eq(123L), eq("555"), any()); verify(redisClient, never()).set(any(), any(), any()); }