Merge branch 'master' into 2.0.x
This commit is contained in:
@@ -28,7 +28,6 @@ import org.apache.commons.logging.LogFactory;
|
|||||||
import org.springframework.cloud.client.DefaultServiceInstance;
|
import org.springframework.cloud.client.DefaultServiceInstance;
|
||||||
import org.springframework.cloud.client.ServiceInstance;
|
import org.springframework.cloud.client.ServiceInstance;
|
||||||
import org.springframework.cloud.client.discovery.DiscoveryClient;
|
import org.springframework.cloud.client.discovery.DiscoveryClient;
|
||||||
import org.springframework.cloud.client.discovery.noop.NoopDiscoveryClient;
|
|
||||||
import org.springframework.cloud.contract.stubrunner.RunningStubs;
|
import org.springframework.cloud.contract.stubrunner.RunningStubs;
|
||||||
import org.springframework.cloud.contract.stubrunner.StubFinder;
|
import org.springframework.cloud.contract.stubrunner.StubFinder;
|
||||||
import org.springframework.cloud.contract.stubrunner.util.StringUtils;
|
import org.springframework.cloud.contract.stubrunner.util.StringUtils;
|
||||||
@@ -70,8 +69,8 @@ class StubRunnerDiscoveryClient implements DiscoveryClient {
|
|||||||
this.stubMapperProperties = stubMapperProperties;
|
this.stubMapperProperties = stubMapperProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
private NoopDiscoveryClient noOpDiscoveryClient(String springAppName) {
|
private StubRunnerNoOpDiscoveryClient noOpDiscoveryClient(String springAppName) {
|
||||||
return new NoopDiscoveryClient(new DefaultServiceInstance(springAppName, "localhost", 0, false));
|
return new StubRunnerNoOpDiscoveryClient(new DefaultServiceInstance(springAppName, "localhost", 0, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -153,3 +152,32 @@ class StubRunnerDiscoveryClient implements DiscoveryClient {
|
|||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class StubRunnerNoOpDiscoveryClient implements DiscoveryClient {
|
||||||
|
|
||||||
|
private final ServiceInstance instance;
|
||||||
|
|
||||||
|
public StubRunnerNoOpDiscoveryClient(ServiceInstance instance) {
|
||||||
|
this.instance = instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String description() {
|
||||||
|
return "Spring Cloud Stub Runner No-op DiscoveryClient";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ServiceInstance getLocalServiceInstance() {
|
||||||
|
return this.instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ServiceInstance> getInstances(String serviceId) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getServices() {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.cloud.contract.verifier.messaging.MessageVerifier;
|
import org.springframework.cloud.contract.verifier.messaging.MessageVerifier;
|
||||||
import org.springframework.cloud.stream.config.BindingProperties;
|
import org.springframework.cloud.stream.config.BindingProperties;
|
||||||
import org.springframework.cloud.stream.config.ChannelBindingServiceProperties;
|
import org.springframework.cloud.stream.config.BindingServiceProperties;
|
||||||
import org.springframework.cloud.stream.test.binder.MessageCollector;
|
import org.springframework.cloud.stream.test.binder.MessageCollector;
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
import org.springframework.messaging.Message;
|
import org.springframework.messaging.Message;
|
||||||
@@ -82,8 +82,8 @@ public class StreamStubMessages implements MessageVerifier<Message<?>> {
|
|||||||
|
|
||||||
private String resolvedDestination(String destination) {
|
private String resolvedDestination(String destination) {
|
||||||
try {
|
try {
|
||||||
ChannelBindingServiceProperties channelBindingServiceProperties = this.context
|
BindingServiceProperties channelBindingServiceProperties = this.context
|
||||||
.getBean(ChannelBindingServiceProperties.class);
|
.getBean(BindingServiceProperties.class);
|
||||||
for (Map.Entry<String, BindingProperties> entry : channelBindingServiceProperties
|
for (Map.Entry<String, BindingProperties> entry : channelBindingServiceProperties
|
||||||
.getBindings().entrySet()) {
|
.getBindings().entrySet()) {
|
||||||
if (destination.equals(entry.getValue().getDestination())) {
|
if (destination.equals(entry.getValue().getDestination())) {
|
||||||
|
|||||||
Reference in New Issue
Block a user