use of org.infinispan.xsite.XSiteAdminOperations.OFFLINE in project infinispan by infinispan.
the class XSiteResourceTest method testPushState.
@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)));
}
Aggregations