From 4f7884f427a78bb4b0a6ce6abc5f1494e66a742d Mon Sep 17 00:00:00 2001 From: Asi Bross Date: Thu, 5 Aug 2021 10:46:26 -0700 Subject: [PATCH] Change LegacyEurekaClientProvider to use DiscoveryManager::getEurekaClient method --- .../netflix/niws/loadbalancer/LegacyEurekaClientProvider.java | 2 +- .../DiscoveryEnabledLoadBalancerSupportsPortOverrideTest.java | 2 +- .../DiscoveryEnabledLoadBalancerSupportsUseIpAddrTest.java | 2 +- .../test/java/com/netflix/niws/loadbalancer/LBBuilderTest.java | 2 +- .../netflix/ribbon/testutils/MockedDiscoveryServerListTest.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ribbon-eureka/src/main/java/com/netflix/niws/loadbalancer/LegacyEurekaClientProvider.java b/ribbon-eureka/src/main/java/com/netflix/niws/loadbalancer/LegacyEurekaClientProvider.java index 5ccadc198..e866e63b5 100644 --- a/ribbon-eureka/src/main/java/com/netflix/niws/loadbalancer/LegacyEurekaClientProvider.java +++ b/ribbon-eureka/src/main/java/com/netflix/niws/loadbalancer/LegacyEurekaClientProvider.java @@ -15,7 +15,7 @@ class LegacyEurekaClientProvider implements Provider { @Override public synchronized EurekaClient get() { if (eurekaClient == null) { - eurekaClient = DiscoveryManager.getInstance().getDiscoveryClient(); + eurekaClient = DiscoveryManager.getInstance().getEurekaClient(); } return eurekaClient; diff --git a/ribbon-eureka/src/test/java/com/netflix/niws/loadbalancer/DiscoveryEnabledLoadBalancerSupportsPortOverrideTest.java b/ribbon-eureka/src/test/java/com/netflix/niws/loadbalancer/DiscoveryEnabledLoadBalancerSupportsPortOverrideTest.java index 3ad809e29..ab7677967 100644 --- a/ribbon-eureka/src/test/java/com/netflix/niws/loadbalancer/DiscoveryEnabledLoadBalancerSupportsPortOverrideTest.java +++ b/ribbon-eureka/src/test/java/com/netflix/niws/loadbalancer/DiscoveryEnabledLoadBalancerSupportsPortOverrideTest.java @@ -78,7 +78,7 @@ public void setupMock(){ DiscoveryManager mockedDiscoveryManager = createMock(DiscoveryManager.class); expect(DiscoveryManager.getInstance()).andReturn(mockedDiscoveryManager).anyTimes(); - expect(mockedDiscoveryManager.getDiscoveryClient()).andReturn(mockedDiscoveryClient).anyTimes(); + expect(mockedDiscoveryManager.getEurekaClient()).andReturn(mockedDiscoveryClient).anyTimes(); expect(mockedDiscoveryClient.getInstancesByVipAddress("dummy", false, "region")).andReturn(dummyII).anyTimes(); expect(mockedDiscoveryClient.getInstancesByVipAddress("secureDummy", true, "region")).andReturn(secureDummyII).anyTimes(); diff --git a/ribbon-eureka/src/test/java/com/netflix/niws/loadbalancer/DiscoveryEnabledLoadBalancerSupportsUseIpAddrTest.java b/ribbon-eureka/src/test/java/com/netflix/niws/loadbalancer/DiscoveryEnabledLoadBalancerSupportsUseIpAddrTest.java index 304db57d6..f64e9dd15 100644 --- a/ribbon-eureka/src/test/java/com/netflix/niws/loadbalancer/DiscoveryEnabledLoadBalancerSupportsUseIpAddrTest.java +++ b/ribbon-eureka/src/test/java/com/netflix/niws/loadbalancer/DiscoveryEnabledLoadBalancerSupportsUseIpAddrTest.java @@ -76,7 +76,7 @@ public void setupMock(){ DiscoveryManager mockedDiscoveryManager = createMock(DiscoveryManager.class); expect(DiscoveryManager.getInstance()).andReturn(mockedDiscoveryManager).anyTimes(); - expect(mockedDiscoveryManager.getDiscoveryClient()).andReturn(mockedDiscoveryClient).anyTimes(); + expect(mockedDiscoveryManager.getEurekaClient()).andReturn(mockedDiscoveryClient).anyTimes(); expect(mockedDiscoveryClient.getInstancesByVipAddress("dummy", false, "region")).andReturn(servers).anyTimes(); diff --git a/ribbon-eureka/src/test/java/com/netflix/niws/loadbalancer/LBBuilderTest.java b/ribbon-eureka/src/test/java/com/netflix/niws/loadbalancer/LBBuilderTest.java index 7be0c3d8d..ef81b2f81 100644 --- a/ribbon-eureka/src/test/java/com/netflix/niws/loadbalancer/LBBuilderTest.java +++ b/ribbon-eureka/src/test/java/com/netflix/niws/loadbalancer/LBBuilderTest.java @@ -69,7 +69,7 @@ public void setupMock(){ DiscoveryManager mockedDiscoveryManager = createMock(DiscoveryManager.class); expect(DiscoveryManager.getInstance()).andReturn(mockedDiscoveryManager).anyTimes(); - expect(mockedDiscoveryManager.getDiscoveryClient()).andReturn(mockedDiscoveryClient).anyTimes(); + expect(mockedDiscoveryManager.getEurekaClient()).andReturn(mockedDiscoveryClient).anyTimes(); expect(mockedDiscoveryClient.getInstancesByVipAddress("dummy:7001", false, null)).andReturn(instances).anyTimes(); diff --git a/ribbon-test/src/main/java/com/netflix/ribbon/testutils/MockedDiscoveryServerListTest.java b/ribbon-test/src/main/java/com/netflix/ribbon/testutils/MockedDiscoveryServerListTest.java index 111b8256a..e1ff5e105 100644 --- a/ribbon-test/src/main/java/com/netflix/ribbon/testutils/MockedDiscoveryServerListTest.java +++ b/ribbon-test/src/main/java/com/netflix/ribbon/testutils/MockedDiscoveryServerListTest.java @@ -74,7 +74,7 @@ public void setupMock(){ expect(mockedDiscoveryClient.getEurekaClientConfig()).andReturn(new DefaultEurekaClientConfig()).anyTimes(); expect(DiscoveryManager.getInstance()).andReturn(mockedDiscoveryManager).anyTimes(); - expect(mockedDiscoveryManager.getDiscoveryClient()).andReturn(mockedDiscoveryClient).anyTimes(); + expect(mockedDiscoveryManager.getEurekaClient()).andReturn(mockedDiscoveryClient).anyTimes(); expect(mockedDiscoveryClient.getInstancesByVipAddress(getVipAddress(), false, null)).andReturn(instances).anyTimes();