Search in sources :

Example 1 with Jersey2TransportClientFactories

use of com.netflix.discovery.shared.transport.jersey2.Jersey2TransportClientFactories in project eureka by Netflix.

the class Jersey2EurekaModuleTest method testDI.

@SuppressWarnings("deprecation")
@Test
public void testDI() {
    InstanceInfo instanceInfo = injector.getInstance(InstanceInfo.class);
    Assert.assertEquals(ApplicationInfoManager.getInstance().getInfo(), instanceInfo);
    EurekaClient eurekaClient = injector.getInstance(EurekaClient.class);
    DiscoveryClient discoveryClient = injector.getInstance(DiscoveryClient.class);
    Assert.assertEquals(DiscoveryManager.getInstance().getEurekaClient(), eurekaClient);
    Assert.assertEquals(DiscoveryManager.getInstance().getDiscoveryClient(), discoveryClient);
    Assert.assertEquals(eurekaClient, discoveryClient);
    EurekaClientConfig eurekaClientConfig = injector.getInstance(EurekaClientConfig.class);
    Assert.assertEquals(DiscoveryManager.getInstance().getEurekaClientConfig(), eurekaClientConfig);
    EurekaInstanceConfig eurekaInstanceConfig = injector.getInstance(EurekaInstanceConfig.class);
    Assert.assertEquals(DiscoveryManager.getInstance().getEurekaInstanceConfig(), eurekaInstanceConfig);
    Binding<TransportClientFactories> binding = injector.getExistingBinding(Key.get(TransportClientFactories.class));
    // has a binding for jersey2
    Assert.assertNotNull(binding);
    TransportClientFactories transportClientFactories = injector.getInstance(TransportClientFactories.class);
    Assert.assertTrue(transportClientFactories instanceof Jersey2TransportClientFactories);
}
Also used : EurekaClientConfig(com.netflix.discovery.EurekaClientConfig) Jersey2TransportClientFactories(com.netflix.discovery.shared.transport.jersey2.Jersey2TransportClientFactories) EurekaInstanceConfig(com.netflix.appinfo.EurekaInstanceConfig) EurekaClient(com.netflix.discovery.EurekaClient) DiscoveryClient(com.netflix.discovery.DiscoveryClient) Jersey2TransportClientFactories(com.netflix.discovery.shared.transport.jersey2.Jersey2TransportClientFactories) TransportClientFactories(com.netflix.discovery.shared.transport.jersey.TransportClientFactories) InstanceInfo(com.netflix.appinfo.InstanceInfo) Test(org.junit.Test)

Aggregations

EurekaInstanceConfig (com.netflix.appinfo.EurekaInstanceConfig)1 InstanceInfo (com.netflix.appinfo.InstanceInfo)1 DiscoveryClient (com.netflix.discovery.DiscoveryClient)1 EurekaClient (com.netflix.discovery.EurekaClient)1 EurekaClientConfig (com.netflix.discovery.EurekaClientConfig)1 TransportClientFactories (com.netflix.discovery.shared.transport.jersey.TransportClientFactories)1 Jersey2TransportClientFactories (com.netflix.discovery.shared.transport.jersey2.Jersey2TransportClientFactories)1 Test (org.junit.Test)1