Adjust to changes in commons.

This commit is contained in:
Olga Maciaszek-Sharma
2020-12-10 14:03:36 +01:00
parent e1ed4c9f00
commit 24884ec277
4 changed files with 16 additions and 5 deletions

View File

@@ -30,9 +30,11 @@ import org.junit.jupiter.params.provider.MethodSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.cloud.client.DefaultServiceInstance;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClient;
import org.springframework.cloud.loadbalancer.core.ServiceInstanceListSupplier;
import org.springframework.cloud.loadbalancer.support.ServiceInstanceListSuppliers;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.sleuth.Span;
@@ -149,8 +151,8 @@ public class WebClientExceptionTests {
@Bean
public ServiceInstanceListSupplier serviceInstanceListSupplier(Environment env) {
return ServiceInstanceListSupplier.fixed(env)
.instance("invalid.host.to.break.tests", 1234, "exceptionservice").build();
return ServiceInstanceListSuppliers.from("exceptionservice", new DefaultServiceInstance(
"exceptionservice" + "-1", "exceptionservice", "invalid.host.to.break.tests", 1234, false));
}
}

View File

@@ -30,9 +30,11 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.cloud.client.DefaultServiceInstance;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClient;
import org.springframework.cloud.loadbalancer.core.ServiceInstanceListSupplier;
import org.springframework.cloud.loadbalancer.support.ServiceInstanceListSuppliers;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.sleuth.Span;
@@ -181,7 +183,8 @@ public abstract class WebClientNotSampledTests {
@Bean
public ServiceInstanceListSupplier serviceInstanceListSupplier(Environment env) {
return ServiceInstanceListSupplier.fixed(env).instance(this.port, "fooservice").build();
return ServiceInstanceListSuppliers.from("fooservice",
new DefaultServiceInstance("fooservice" + "-1", "fooservice", "localhost", port, false));
}
}

View File

@@ -28,8 +28,10 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.cloud.client.DefaultServiceInstance;
import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClient;
import org.springframework.cloud.loadbalancer.core.ServiceInstanceListSupplier;
import org.springframework.cloud.loadbalancer.support.ServiceInstanceListSuppliers;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.sleuth.Span;
@@ -123,7 +125,8 @@ public abstract class WebClientCustomParserTests {
@Bean
public ServiceInstanceListSupplier serviceInstanceListSupplier(Environment env) {
return ServiceInstanceListSupplier.fixed(env).instance(this.port, "fooservice").build();
return ServiceInstanceListSuppliers.from("fooservice",
new DefaultServiceInstance("fooservice" + "-1", "fooservice", "localhost", port, false));
}
}

View File

@@ -50,9 +50,11 @@ import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.boot.web.client.RestTemplateCustomizer;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.boot.web.servlet.error.ErrorAttributes;
import org.springframework.cloud.client.DefaultServiceInstance;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClient;
import org.springframework.cloud.loadbalancer.core.ServiceInstanceListSupplier;
import org.springframework.cloud.loadbalancer.support.ServiceInstanceListSuppliers;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.sleuth.Span;
@@ -544,7 +546,8 @@ public abstract class WebClientTests {
@Bean
public ServiceInstanceListSupplier serviceInstanceListSupplier(Environment env) {
return ServiceInstanceListSupplier.fixed(env).instance(this.port, "fooservice").build();
return ServiceInstanceListSuppliers.from("fooservice",
new DefaultServiceInstance("fooservice" + "-1", "fooservice", "localhost", port, false));
}
}