Search in sources :

Example 41 with Applications

use of com.netflix.discovery.shared.Applications in project eureka by Netflix.

the class EurekaHttpClientCompatibilityTestSuite method testGetSecureVipRequest.

@Test
public void testGetSecureVipRequest() throws Exception {
    Applications vipApps = InstanceInfoGenerator.newBuilder(1, 2).build().toApplications();
    String secureVipAddress = vipApps.getRegisteredApplications().get(0).getInstances().get(0).getSecureVipAddress();
    when(requestHandler.getSecureVip(secureVipAddress)).thenReturn(createResponse(vipApps));
    EurekaHttpResponse<Applications> httpResponse = getEurekaHttpClient().getSecureVip(secureVipAddress);
    verifyResponseOkWithEntity(vipApps, httpResponse);
}
Also used : Applications(com.netflix.discovery.shared.Applications) Test(org.junit.Test)

Example 42 with Applications

use of com.netflix.discovery.shared.Applications in project eureka by Netflix.

the class EurekaHttpClientCompatibilityTestSuite method testGetApplicationsWithRemoteRegionRequest.

@Test
public void testGetApplicationsWithRemoteRegionRequest() throws Exception {
    Applications apps = InstanceInfoGenerator.newBuilder(2, 1).build().toApplications();
    when(requestHandler.getApplications(REMOTE_REGION)).thenReturn(createResponse(apps));
    EurekaHttpResponse<Applications> httpResponse = getEurekaHttpClient().getApplications(REMOTE_REGION);
    verifyResponseOkWithEntity(apps, httpResponse);
}
Also used : Applications(com.netflix.discovery.shared.Applications) Test(org.junit.Test)

Example 43 with Applications

use of com.netflix.discovery.shared.Applications in project eureka by Netflix.

the class EurekaHttpClientCompatibilityTestSuite method testGetDeltaWithRemoteRegionRequest.

@Test
public void testGetDeltaWithRemoteRegionRequest() throws Exception {
    Applications delta = InstanceInfoGenerator.newBuilder(2, 1).build().takeDelta(2);
    when(requestHandler.getDelta(REMOTE_REGION)).thenReturn(createResponse(delta));
    EurekaHttpResponse<Applications> httpResponse = getEurekaHttpClient().getDelta(REMOTE_REGION);
    verifyResponseOkWithEntity(delta, httpResponse);
}
Also used : Applications(com.netflix.discovery.shared.Applications) Test(org.junit.Test)

Example 44 with Applications

use of com.netflix.discovery.shared.Applications in project eureka by Netflix.

the class EurekaHttpClientCompatibilityTestSuite method testGetDeltaRequest.

@Test
public void testGetDeltaRequest() throws Exception {
    Applications delta = InstanceInfoGenerator.newBuilder(2, 1).build().takeDelta(2);
    when(requestHandler.getDelta()).thenReturn(createResponse(delta));
    EurekaHttpResponse<Applications> httpResponse = getEurekaHttpClient().getDelta();
    verifyResponseOkWithEntity(delta, httpResponse);
}
Also used : Applications(com.netflix.discovery.shared.Applications) Test(org.junit.Test)

Example 45 with Applications

use of com.netflix.discovery.shared.Applications in project eureka by Netflix.

the class EurekaHttpClientCompatibilityTestSuite method testGetSecureVipWithRemoteRegionRequest.

@Test
public void testGetSecureVipWithRemoteRegionRequest() throws Exception {
    Applications vipApps = InstanceInfoGenerator.newBuilder(1, 2).build().toApplications();
    String secureVipAddress = vipApps.getRegisteredApplications().get(0).getInstances().get(0).getSecureVipAddress();
    when(requestHandler.getSecureVip(secureVipAddress, REMOTE_REGION)).thenReturn(createResponse(vipApps));
    EurekaHttpResponse<Applications> httpResponse = getEurekaHttpClient().getSecureVip(secureVipAddress, REMOTE_REGION);
    verifyResponseOkWithEntity(vipApps, httpResponse);
}
Also used : Applications(com.netflix.discovery.shared.Applications) Test(org.junit.Test)

Aggregations

Applications (com.netflix.discovery.shared.Applications)85 Test (org.junit.Test)43 Application (com.netflix.discovery.shared.Application)25 InstanceInfo (com.netflix.appinfo.InstanceInfo)22 EurekaEntityFunctions.toApplications (com.netflix.discovery.util.EurekaEntityFunctions.toApplications)11 EurekaEntityFunctions.mergeApplications (com.netflix.discovery.util.EurekaEntityFunctions.mergeApplications)10 EurekaEntityFunctions.copyApplications (com.netflix.discovery.util.EurekaEntityFunctions.copyApplications)8 DecoderWrapper (com.netflix.discovery.converters.wrappers.DecoderWrapper)6 List (java.util.List)6 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)6 CodecWrappers (com.netflix.discovery.converters.wrappers.CodecWrappers)5 InstanceInfoGenerator (com.netflix.discovery.util.InstanceInfoGenerator)5 ArrayList (java.util.ArrayList)5 HashMap (java.util.HashMap)5 ByteArrayInputStream (java.io.ByteArrayInputStream)4 ByteArrayOutputStream (java.io.ByteArrayOutputStream)4 Response (javax.ws.rs.core.Response)4 IOException (java.io.IOException)3 InputStream (java.io.InputStream)3 Map (java.util.Map)3