Search in sources :

Example 16 with EurekaInstanceConfig

use of com.netflix.appinfo.EurekaInstanceConfig in project riposte by Nike-Inc.

the class EurekaHandlerTest method createEurekaInstanceConfig_returns_MyDataCenterInstanceConfig_when_datacenterType_is_null_or_MyOwn_or_invalid.

@DataProvider(value = { "null", "MyOwn", "not-a-real-datacenter-type" })
@Test
public void createEurekaInstanceConfig_returns_MyDataCenterInstanceConfig_when_datacenterType_is_null_or_MyOwn_or_invalid(String datacenterType) {
    // given
    doReturn(datacenterType).when(datacenterTypePropertySupplierMock).get();
    // when
    EurekaInstanceConfig instanceConfig = handlerSpy.createEurekaInstanceConfig();
    // then
    assertThat(instanceConfig).isInstanceOf(MyDataCenterInstanceConfig.class);
    assertThat(Whitebox.getInternalState(instanceConfig, "namespace")).isEqualTo(handlerSpy.eurekaClientNamespace);
}
Also used : EurekaInstanceConfig(com.netflix.appinfo.EurekaInstanceConfig) DataProvider(com.tngtech.java.junit.dataprovider.DataProvider) Test(org.junit.Test)

Aggregations

EurekaInstanceConfig (com.netflix.appinfo.EurekaInstanceConfig)16 Test (org.junit.Test)8 EurekaClientConfig (com.netflix.discovery.EurekaClientConfig)6 ApplicationInfoManager (com.netflix.appinfo.ApplicationInfoManager)5 DiscoveryClient (com.netflix.discovery.DiscoveryClient)5 AbstractModule (com.google.inject.AbstractModule)4 InstanceInfo (com.netflix.appinfo.InstanceInfo)4 DefaultEurekaClientConfig (com.netflix.discovery.DefaultEurekaClientConfig)4 EurekaClient (com.netflix.discovery.EurekaClient)4 MyDataCenterInstanceConfig (com.netflix.appinfo.MyDataCenterInstanceConfig)3 Archaius2VipAddressResolver (com.netflix.appinfo.providers.Archaius2VipAddressResolver)2 VipAddressResolver (com.netflix.appinfo.providers.VipAddressResolver)2 TransportClientFactories (com.netflix.discovery.shared.transport.jersey.TransportClientFactories)2 LifecycleInjector (com.netflix.governator.LifecycleInjector)2 DataProvider (com.tngtech.java.junit.dataprovider.DataProvider)2 Before (org.junit.Before)2 AmazonInfo (com.netflix.appinfo.AmazonInfo)1 CloudInstanceConfig (com.netflix.appinfo.CloudInstanceConfig)1 DataCenterInfo (com.netflix.appinfo.DataCenterInfo)1 Ec2EurekaArchaius2InstanceConfig (com.netflix.appinfo.Ec2EurekaArchaius2InstanceConfig)1