use of com.netflix.discovery.shared.Application in project eureka by Netflix.
the class EurekaEntityFunctions method deepCopyApplication.
public static Application deepCopyApplication(Application source) {
Application result = new Application(source.getName());
deepCopyApplication(source, result, EurekaEntityTransformers.<InstanceInfo>identity());
return result;
}
use of com.netflix.discovery.shared.Application in project eureka by Netflix.
the class EurekaEntityFunctions method toApplications.
public static Applications toApplications(List<InstanceInfo> instances) {
Applications result = new Applications();
for (InstanceInfo instance : instances) {
Application app = result.getRegisteredApplications(instance.getAppName());
if (app == null) {
app = new Application(instance.getAppName());
result.addApplication(app);
}
app.addInstance(instance);
}
return updateMeta(result);
}
use of com.netflix.discovery.shared.Application in project eureka by Netflix.
the class BackUpRegistryTest method createLocalApps.
private Application createLocalApps() {
Application myapp = new Application(LOCAL_REGION_APP_NAME);
InstanceInfo instanceInfo = createLocalInstance(LOCAL_REGION_INSTANCE_1_HOSTNAME);
myapp.addInstance(instanceInfo);
return myapp;
}
use of com.netflix.discovery.shared.Application in project eureka by Netflix.
the class BackUpRegistryTest method testLocalOnly.
@Test
public void testLocalOnly() throws Exception {
setUp(false);
Applications applications = client.getApplications();
List<Application> registeredApplications = applications.getRegisteredApplications();
System.out.println("***" + registeredApplications);
Assert.assertNotNull("Local region apps not found.", registeredApplications);
Assert.assertEquals("Local apps size not as expected.", 1, registeredApplications.size());
Assert.assertEquals("Local region apps not present.", LOCAL_REGION_APP_NAME, registeredApplications.get(0).getName());
}
use of com.netflix.discovery.shared.Application in project eureka by Netflix.
the class BackUpRegistryTest method createRemoteApps.
private Application createRemoteApps() {
Application myapp = new Application(REMOTE_REGION_APP_NAME);
InstanceInfo instanceInfo = createRemoteInstance(REMOTE_REGION_INSTANCE_1_HOSTNAME);
myapp.addInstance(instanceInfo);
return myapp;
}
Aggregations