Changed the impl due to the composites

This commit is contained in:
Marcin Grzejszczak
2020-11-05 11:48:47 +01:00
parent 77de1e74b9
commit ef62653671
2 changed files with 4 additions and 20 deletions

View File

@@ -20,7 +20,6 @@ import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.client.discovery.DiscoveryClient;
@@ -28,6 +27,8 @@ import org.springframework.cloud.client.discovery.ReactiveDiscoveryClient;
import org.springframework.cloud.contract.stubrunner.StubFinder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.core.env.Environment;
/**
@@ -49,18 +50,18 @@ public class StubRunnerSpringCloudAutoConfiguration {
}
@Bean
@ConditionalOnMissingBean(DiscoveryClient.class)
@ConditionalOnStubbedDiscoveryEnabled
@ConditionalOnProperty(value = "stubrunner.cloud.delegate.enabled", havingValue = "false", matchIfMissing = true)
@Order(Ordered.HIGHEST_PRECEDENCE)
public DiscoveryClient noOpStubRunnerDiscoveryClient(StubFinder stubFinder,
StubMapperProperties stubMapperProperties) {
return new StubRunnerDiscoveryClient(stubFinder, stubMapperProperties);
}
@Bean
@ConditionalOnMissingBean(ReactiveDiscoveryClient.class)
@ConditionalOnStubbedDiscoveryEnabled
@ConditionalOnProperty(value = "stubrunner.cloud.delegate.enabled", havingValue = "false", matchIfMissing = true)
@Order(Ordered.HIGHEST_PRECEDENCE)
public ReactiveDiscoveryClient noOpStubRunnerReactiveDiscoveryClient(StubFinder stubFinder,
StubMapperProperties stubMapperProperties) {
return new StubRunnerReactiveDiscoveryClient(stubFinder, stubMapperProperties);

View File

@@ -1,17 +0,0 @@
stubrunner:
cloud.stubbed.discovery.enabled: true
spring.cloud:
zookeeper:
enabled: false
discovery.enabled: false
consul:
enabled: false
discovery.enabled: false
service-registry.enabled: false
eureka.client.enabled: false
ribbon.eureka.enabled: false
spring:
cloud:
loadbalancer:
ribbon:
enabled: false # Use Reactive Load Balancer