registerInstanceLocally(createLocalInstance(LOCAL_REGION_INSTANCE_2_HOSTNAME)); /// local delta
waitForDeltaToBeRetrieved();
Applications appDelta = registry.getApplicationDeltasFromMultipleRegions(null);
List<Application> registeredApplications = appDelta.getRegisteredApplications();
Assert.assertEquals("Apps size from remote regions do not match", 2, registeredApplications.size());
Application locaApplication = null;
Application remApplication = null;
for (Application registeredApplication : registeredApplications) {
if (registeredApplication.getName().equalsIgnoreCase(LOCAL_REGION_APP_NAME)) {
locaApplication = registeredApplication;
}
if (registeredApplication.getName().equalsIgnoreCase(REMOTE_REGION_APP_NAME)) {
remApplication = registeredApplication;
}
}
Assert.assertNotNull("Did not find local registry app in delta.", locaApplication);
Assert.assertEquals("Local registry app instance count in delta not as expected.", 1,
locaApplication.getInstances().size());
Assert.assertNotNull("Did not find remote registry app in delta", remApplication);
Assert.assertEquals("Remote registry app instance count in delta not as expected.", 1,
remApplication.getInstances().size());
}