|
|
@ -17,9 +17,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
package com.tencent.cloud.rpc.enhancement.config;
|
|
|
|
package com.tencent.cloud.rpc.enhancement.config;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
import java.net.URI;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.tencent.cloud.polaris.context.config.PolarisContextAutoConfiguration;
|
|
|
|
import com.tencent.cloud.polaris.context.config.PolarisContextAutoConfiguration;
|
|
|
|
import com.tencent.cloud.rpc.enhancement.feign.EnhancedFeignBeanPostProcessor;
|
|
|
|
import com.tencent.cloud.rpc.enhancement.feign.EnhancedFeignBeanPostProcessor;
|
|
|
|
import com.tencent.cloud.rpc.enhancement.feign.EnhancedFeignPluginRunner;
|
|
|
|
import com.tencent.cloud.rpc.enhancement.feign.EnhancedFeignPluginRunner;
|
|
|
@ -32,12 +29,7 @@ import org.junit.Test;
|
|
|
|
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
|
|
|
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
|
|
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
|
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
|
|
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
|
|
|
|
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
|
|
|
|
import org.springframework.cloud.client.ServiceInstance;
|
|
|
|
|
|
|
|
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
|
|
|
|
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
|
|
|
|
import org.springframework.cloud.client.loadbalancer.LoadBalancerAutoConfiguration;
|
|
|
|
|
|
|
|
import org.springframework.cloud.client.loadbalancer.LoadBalancerClient;
|
|
|
|
|
|
|
|
import org.springframework.cloud.client.loadbalancer.LoadBalancerRequest;
|
|
|
|
|
|
|
|
import org.springframework.cloud.client.loadbalancer.Request;
|
|
|
|
|
|
|
|
import org.springframework.cloud.openfeign.loadbalancer.FeignLoadBalancerAutoConfiguration;
|
|
|
|
import org.springframework.cloud.openfeign.loadbalancer.FeignLoadBalancerAutoConfiguration;
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
@ -57,7 +49,6 @@ public class RpcEnhancementAutoConfigurationTest {
|
|
|
|
PolarisContextAutoConfiguration.class,
|
|
|
|
PolarisContextAutoConfiguration.class,
|
|
|
|
RpcEnhancementAutoConfiguration.class,
|
|
|
|
RpcEnhancementAutoConfiguration.class,
|
|
|
|
PolarisRestTemplateAutoConfigurationTester.class,
|
|
|
|
PolarisRestTemplateAutoConfigurationTester.class,
|
|
|
|
LoadBalancerAutoConfiguration.class,
|
|
|
|
|
|
|
|
FeignLoadBalancerAutoConfiguration.class))
|
|
|
|
FeignLoadBalancerAutoConfiguration.class))
|
|
|
|
.withPropertyValues("spring.cloud.polaris.circuitbreaker.enabled=true");
|
|
|
|
.withPropertyValues("spring.cloud.polaris.circuitbreaker.enabled=true");
|
|
|
|
|
|
|
|
|
|
|
@ -85,36 +76,5 @@ public class RpcEnhancementAutoConfigurationTest {
|
|
|
|
RestTemplate restTemplate() {
|
|
|
|
RestTemplate restTemplate() {
|
|
|
|
return new RestTemplate();
|
|
|
|
return new RestTemplate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
|
|
|
|
LoadBalancerClient loadBalancerClient() {
|
|
|
|
|
|
|
|
return new LoadBalancerClient() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public ServiceInstance choose(String serviceId) {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public <T> ServiceInstance choose(String serviceId, Request<T> request) {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public <T> T execute(String serviceId, LoadBalancerRequest<T> request) throws IOException {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public <T> T execute(String serviceId, ServiceInstance serviceInstance, LoadBalancerRequest<T> request) throws IOException {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public URI reconstructURI(ServiceInstance instance, URI original) {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|