@Test public void testPushState() { RestCacheClient cache = getCacheClient(LON); RestCacheClient backupCache = getCacheClient(NYC); String key = "key"; String value = "value"; Function<String, Integer> keyOnBackup = k -> responseStatus(backupCache.get(key)); takeBackupOffline(LON, NYC); assertEquals(OFFLINE, getBackupStatus(LON, NYC)); assertEquals(ONLINE, getBackupStatus(LON, SFO)); assertNoContent(cache.put(key, value)); assertEquals(404, (int) keyOnBackup.apply(key)); assertSuccessful(cache.pushSiteState(NYC)); assertEquals(ONLINE, getBackupStatus(LON, NYC)); eventuallyEquals("OK", () -> pushStateStatus(cache, NYC)); assertEquals(200, responseStatus(backupCache.get(key))); }
private CompletionStage<RestResponse> pushStateStatus(RestRequest request) { return statusOperation(request, PUSH_STATE_STATUS); }
XSiteResource implements ResourceHandler { private CompletionStage<RestResponse> pushStateStatus(RestRequest request) { return statusOperation(request, PUSH_STATE_STATUS); } }
XSiteResource implements ResourceHandler { private CompletionStage<RestResponse> pushStateStatus(RestRequest request) { return statusOperation(request, PUSH_STATE_STATUS); } XSiteResource(InvocationHelper invocationHelper); }
XSiteResource implements ResourceHandler { private CompletionStage<RestResponse> pushStateStatus(RestRequest request) { return statusOperation(request, PUSH_STATE_STATUS); } XSiteResource(InvocationHelper invocationHelper); @Override Invocations getInvocations(); }
XSiteResource implements ResourceHandler { private CompletionStage<RestResponse> pushStateStatus(RestRequest request) { return statusOperation(request, PUSH_STATE_STATUS); } XSiteResource(InvocationHelper invocationHelper); @Override Invocations getInvocations(); static final String AFTER_FAILURES_FIELD; static final String MIN_WAIT_FIELD; }