diff --git a/spring-cloud-consul-discovery/src/main/java/org/springframework/cloud/consul/discovery/ConsulServiceInstance.java b/spring-cloud-consul-discovery/src/main/java/org/springframework/cloud/consul/discovery/ConsulServiceInstance.java index e81697be..240422c8 100644 --- a/spring-cloud-consul-discovery/src/main/java/org/springframework/cloud/consul/discovery/ConsulServiceInstance.java +++ b/spring-cloud-consul-discovery/src/main/java/org/springframework/cloud/consul/discovery/ConsulServiceInstance.java @@ -34,11 +34,13 @@ public class ConsulServiceInstance extends DefaultServiceInstance { public ConsulServiceInstance(HealthService healthService, String serviceId) { this(healthService.getService().getId(), serviceId, findHost(healthService), - healthService.getService().getPort(), getSecure(healthService), getMetadata(healthService), healthService.getService().getTags()); + healthService.getService().getPort(), getSecure(healthService), getMetadata(healthService), + healthService.getService().getTags()); this.healthService = healthService; } - public ConsulServiceInstance(String instanceId, String serviceId, String host, int port, boolean secure, Map metadata, List tags) { + public ConsulServiceInstance(String instanceId, String serviceId, String host, int port, boolean secure, + Map metadata, List tags) { super(instanceId, serviceId, host, port, secure, metadata); } @@ -83,16 +85,11 @@ public class ConsulServiceInstance extends DefaultServiceInstance { @Override public String toString() { - return new ToStringCreator(this) - .append("instanceId", getInstanceId()) - .append("serviceId", getServiceId()) - .append("host", getHost()) - .append("port", getPort()) - .append("secure", isSecure()) - .append("metadata", getMetadata()) - .append("uri", getUri()) - .append("healthService", healthService) - .toString(); + return new ToStringCreator(this).append("instanceId", getInstanceId()).append("serviceId", getServiceId()) + .append("host", getHost()).append("port", getPort()).append("secure", isSecure()) + .append("metadata", getMetadata()).append("uri", getUri()).append("healthService", healthService) + .toString(); } + } diff --git a/spring-cloud-consul-discovery/src/test/java/org/springframework/cloud/consul/discovery/configclient/TestConsulDiscoveryClientBootstrapConfiguration.java b/spring-cloud-consul-discovery/src/test/java/org/springframework/cloud/consul/discovery/configclient/TestConsulDiscoveryClientBootstrapConfiguration.java index 8f23b396..3a8f018c 100644 --- a/spring-cloud-consul-discovery/src/test/java/org/springframework/cloud/consul/discovery/configclient/TestConsulDiscoveryClientBootstrapConfiguration.java +++ b/spring-cloud-consul-discovery/src/test/java/org/springframework/cloud/consul/discovery/configclient/TestConsulDiscoveryClientBootstrapConfiguration.java @@ -37,8 +37,8 @@ public class TestConsulDiscoveryClientBootstrapConfiguration { @Bean public ConsulDiscoveryClient consulDiscoveryClient(ConsulDiscoveryProperties properties) { ConsulDiscoveryClient client = mock(ConsulDiscoveryClient.class); - ConsulServiceInstance instance = new ConsulServiceInstance("configserver1", "configserver", properties.getHostname(), - properties.getPort(), false); + 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;