Adjust to changes in main.
This commit is contained in:
@@ -139,7 +139,8 @@ public class LoadBalancerClientConfiguration {
|
||||
@ConditionalOnMissingBean
|
||||
@Conditional(WeightedConfigurationCondition.class)
|
||||
public ServiceInstanceListSupplier weightedServiceInstanceListSupplier(ConfigurableApplicationContext context) {
|
||||
return ServiceInstanceListSupplier.builder().withDiscoveryClient().withWeighted().build(context);
|
||||
return ServiceInstanceListSupplier.builder().withDiscoveryClient().withWeighted().withCaching()
|
||||
.build(context);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -203,7 +204,8 @@ public class LoadBalancerClientConfiguration {
|
||||
@ConditionalOnMissingBean
|
||||
@Conditional(WeightedConfigurationCondition.class)
|
||||
public ServiceInstanceListSupplier weightedServiceInstanceListSupplier(ConfigurableApplicationContext context) {
|
||||
return ServiceInstanceListSupplier.builder().withBlockingDiscoveryClient().withWeighted().build(context);
|
||||
return ServiceInstanceListSupplier.builder().withBlockingDiscoveryClient().withWeighted().withCaching()
|
||||
.build(context);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -120,10 +120,13 @@ class LoadBalancerClientConfigurationTests {
|
||||
reactiveDiscoveryClientRunner.withUserConfiguration(TestConfig.class)
|
||||
.withPropertyValues("spring.cloud.loadbalancer.configurations=weighted").run(context -> {
|
||||
ServiceInstanceListSupplier supplier = context.getBean(ServiceInstanceListSupplier.class);
|
||||
then(supplier).isInstanceOf(WeightedServiceInstanceListSupplier.class);
|
||||
then(supplier).isInstanceOf(CachingServiceInstanceListSupplier.class);
|
||||
ServiceInstanceListSupplier delegate = ((DelegatingServiceInstanceListSupplier) supplier)
|
||||
.getDelegate();
|
||||
then(delegate).isInstanceOf(DiscoveryClientServiceInstanceListSupplier.class);
|
||||
then(delegate).isInstanceOf(WeightedServiceInstanceListSupplier.class);
|
||||
ServiceInstanceListSupplier secondDelegate = ((DelegatingServiceInstanceListSupplier) delegate)
|
||||
.getDelegate();
|
||||
then(secondDelegate).isInstanceOf(DiscoveryClientServiceInstanceListSupplier.class);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -204,8 +207,11 @@ class LoadBalancerClientConfigurationTests {
|
||||
blockingDiscoveryClientRunner.withUserConfiguration(RestTemplateTestConfig.class)
|
||||
.withPropertyValues("spring.cloud.loadbalancer.configurations=weighted").run(context -> {
|
||||
ServiceInstanceListSupplier supplier = context.getBean(ServiceInstanceListSupplier.class);
|
||||
then(supplier).isInstanceOf(WeightedServiceInstanceListSupplier.class);
|
||||
then(((DelegatingServiceInstanceListSupplier) supplier).getDelegate())
|
||||
then(supplier).isInstanceOf(CachingServiceInstanceListSupplier.class);
|
||||
ServiceInstanceListSupplier delegate = ((DelegatingServiceInstanceListSupplier) supplier)
|
||||
.getDelegate();
|
||||
then(delegate).isInstanceOf(WeightedServiceInstanceListSupplier.class);
|
||||
then(((DelegatingServiceInstanceListSupplier) delegate).getDelegate())
|
||||
.isInstanceOf(DiscoveryClientServiceInstanceListSupplier.class);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user