Search in sources :

Example 1 with EurekaAccept

use of com.netflix.appinfo.EurekaAccept in project eureka by Netflix.

the class AbstractVIPResourceTest method setUp.

@Override
@Before
public void setUp() throws Exception {
    super.setUp();
    InstanceInfoGenerator instanceInfos = InstanceInfoGenerator.newBuilder(6, 1).build();
    testApplication = instanceInfos.toApplications().getRegisteredApplications().get(0);
    resource = new AbstractVIPResource(serverContext) {

        @Override
        protected Response getVipResponse(String version, String entityName, String acceptHeader, EurekaAccept eurekaAccept, Key.EntityType entityType) {
            return super.getVipResponse(version, entityName, acceptHeader, eurekaAccept, entityType);
        }
    };
    vipName = testApplication.getName() + "#VIP";
    for (InstanceInfo instanceInfo : testApplication.getInstances()) {
        InstanceInfo changed = new InstanceInfo.Builder(instanceInfo).setASGName(// null asgName to get around AwsAsgUtil check
        null).setVIPAddress(// use the same vip address for all the instances in this test
        vipName).build();
        registry.register(changed, false);
    }
}
Also used : Response(javax.ws.rs.core.Response) EurekaAccept(com.netflix.appinfo.EurekaAccept) InstanceInfoGenerator(com.netflix.discovery.util.InstanceInfoGenerator) InstanceInfo(com.netflix.appinfo.InstanceInfo) Key(com.netflix.eureka.registry.Key) Before(org.junit.Before)

Aggregations

EurekaAccept (com.netflix.appinfo.EurekaAccept)1 InstanceInfo (com.netflix.appinfo.InstanceInfo)1 InstanceInfoGenerator (com.netflix.discovery.util.InstanceInfoGenerator)1 Key (com.netflix.eureka.registry.Key)1 Response (javax.ws.rs.core.Response)1 Before (org.junit.Before)1