Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
Signed-off-by: achmelo <[email protected]>
  • Loading branch information
achmelo committed Sep 11, 2023
1 parent 9591b5e commit 5cad7ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ public ApimlDiscoveryClient primaryApimlEurekaClient(ApplicationInfoManager mana
@Bean(destroyMethod = "shutdown")
@ConditionalOnProperty(name = "apiml.service.centralRegistryUrls")
@RefreshScope
public DiscoveryClientWrapper additionalDiscoverClientWrapper(ApplicationInfoManager manager,
EurekaClientConfig config,
@Autowired(required = false) HealthCheckHandler healthCheckHandler
public DiscoveryClientWrapper additionalDiscoveryClientWrapper(ApplicationInfoManager manager,
EurekaClientConfig config,
@Autowired(required = false) HealthCheckHandler healthCheckHandler
) {
ApplicationInfoManager appManager = ProxyUtils.getTargetObject(manager);
List<ApimlDiscoveryClient> listOfDiscoveryClients = new ArrayList<>();
List<ApimlDiscoveryClient> discoveryClientsList = new ArrayList<>();

for (String url : centralRegistryUrls) {

Expand All @@ -91,9 +91,9 @@ public DiscoveryClientWrapper additionalDiscoverClientWrapper(ApplicationInfoMan

final ApimlDiscoveryClient discoveryClientClient = new ApimlDiscoveryClient(appManager, configBean, args, this.context);
discoveryClientClient.registerHealthCheck(healthCheckHandler);
listOfDiscoveryClients.add(discoveryClientClient);
discoveryClientsList.add(discoveryClientClient);
}

return new DiscoveryClientWrapper(listOfDiscoveryClients);
return new DiscoveryClientWrapper(discoveryClientsList);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void givenListOfCentralRegistryURLs_thenCreateNewDiscoveryClientForEach() {
LeaseInfo leaseInfo = mock(LeaseInfo.class);
when(info.getLeaseInfo()).thenReturn(leaseInfo);
EurekaClientConfigBean bean = new EurekaClientConfigBean();
DiscoveryClientWrapper wrapper = dcConfig.additionalDiscoverClientWrapper(manager, bean, null);
DiscoveryClientWrapper wrapper = dcConfig.additionalDiscoveryClientWrapper(manager, bean, null);
assertEquals(2, wrapper.getDiscoveryClients().size());
}
}

0 comments on commit 5cad7ed

Please sign in to comment.