use of org.springframework.cloud.consul.discovery.ConsulServiceInstance in project spring-cloud-consul by spring-cloud.
the class TestConsulDiscoveryClientBootstrapConfiguration method consulDiscoveryClient.
@Bean
public ConsulDiscoveryClient consulDiscoveryClient(ConsulDiscoveryProperties properties) {
ConsulDiscoveryClient client = mock(ConsulDiscoveryClient.class);
ConsulServiceInstance instance = new ConsulServiceInstance("configserver1", "configserver", properties.getHostname(), properties.getPort(), false);
instance.setHealthService(mock(HealthService.class));
given(client.getInstances("configserver")).willReturn(Arrays.asList(instance));
return client;
}
Aggregations