Search in sources :

Example 6 with MyDataCenterInfo

use of com.netflix.appinfo.MyDataCenterInfo in project ribbon by Netflix.

the class MockedDiscoveryServerListTest method getDummyInstanceInfo.

static List<InstanceInfo> getDummyInstanceInfo(String appName, List<Server> serverList) {
    List<InstanceInfo> list = new ArrayList<InstanceInfo>();
    for (Server server : serverList) {
        InstanceInfo info = InstanceInfo.Builder.newBuilder().setAppName(appName).setHostName(server.getHost()).setPort(server.getPort()).setDataCenterInfo(new MyDataCenterInfo(DataCenterInfo.Name.MyOwn)).build();
        list.add(info);
    }
    return list;
}
Also used : MyDataCenterInfo(com.netflix.appinfo.MyDataCenterInfo) Server(com.netflix.loadbalancer.Server) ArrayList(java.util.ArrayList) InstanceInfo(com.netflix.appinfo.InstanceInfo)

Aggregations

InstanceInfo (com.netflix.appinfo.InstanceInfo)6 MyDataCenterInfo (com.netflix.appinfo.MyDataCenterInfo)6 ArrayList (java.util.ArrayList)3 Before (org.junit.Before)2 Test (org.junit.Test)2 AmazonInfo (com.netflix.appinfo.AmazonInfo)1 ApplicationInfoManager (com.netflix.appinfo.ApplicationInfoManager)1 EurekaClientConfig (com.netflix.discovery.EurekaClientConfig)1 CodecWrappers (com.netflix.discovery.converters.wrappers.CodecWrappers)1 DecoderWrapper (com.netflix.discovery.converters.wrappers.DecoderWrapper)1 EncoderWrapper (com.netflix.discovery.converters.wrappers.EncoderWrapper)1 Application (com.netflix.discovery.shared.Application)1 AwsEndpoint (com.netflix.discovery.shared.resolver.aws.AwsEndpoint)1 EurekaTransportConfig (com.netflix.discovery.shared.transport.EurekaTransportConfig)1 EurekaServerContext (com.netflix.eureka.EurekaServerContext)1 PeerEurekaNodes (com.netflix.eureka.cluster.PeerEurekaNodes)1 PeerAwareInstanceRegistry (com.netflix.eureka.registry.PeerAwareInstanceRegistry)1 Server (com.netflix.loadbalancer.Server)1