Adjust changes to existing convention.

This commit is contained in:
OlgaMaciaszek
2018-05-18 15:44:44 +02:00
parent 8504e7e74f
commit 3534e16013
4 changed files with 14 additions and 15 deletions

View File

@@ -46,6 +46,6 @@ public class SimpleDiscoveryClient implements DiscoveryClient {
@Override
public int getOrder() {
return simpleDiscoveryProperties.getOrder();
return this.simpleDiscoveryProperties.getOrder();
}
}

View File

@@ -38,7 +38,7 @@ public class SimpleDiscoveryProperties {
private int order = Ordered.LOWEST_PRECEDENCE;
public Map<String, List<SimpleServiceInstance>> getInstances() {
return instances;
return this.instances;
}
public void setInstances(Map<String, List<SimpleServiceInstance>> instances) {
@@ -46,11 +46,11 @@ public class SimpleDiscoveryProperties {
}
public SimpleServiceInstance getLocal() {
return local;
return this.local;
}
public int getOrder() {
return order;
return this.order;
}
public void setOrder(int order) {

View File

@@ -32,7 +32,7 @@ public class CompositeDiscoveryClientOrderTest {
@Test
public void shouldGetOrderedDiscoveryClients() {
// when:
List<DiscoveryClient> discoveryClients = ((CompositeDiscoveryClient) discoveryClient)
List<DiscoveryClient> discoveryClients = ((CompositeDiscoveryClient) this.discoveryClient)
.getDiscoveryClients();
// then:
@@ -47,7 +47,7 @@ public class CompositeDiscoveryClientOrderTest {
@Test
public void shouldOnlyReturnServiceInstancesForTheHighestPrecedenceDiscoveryClient() {
// when:
List<ServiceInstance> serviceInstances = discoveryClient
List<ServiceInstance> serviceInstances = this.discoveryClient
.getInstances(CUSTOM_SERVICE_ID);
// then:

View File

@@ -35,11 +35,11 @@ public class CompositeDiscoveryClientTests {
@Test
public void getInstancesByServiceIdShouldDelegateCall() {
assertThat(discoveryClient).isInstanceOf(CompositeDiscoveryClient.class);
assertThat(this.discoveryClient).isInstanceOf(CompositeDiscoveryClient.class);
assertThat(discoveryClient.getInstances("service1")).hasSize(2);
assertThat(this.discoveryClient.getInstances("service1")).hasSize(2);
ServiceInstance s1 = discoveryClient.getInstances("service1").get(0);
ServiceInstance s1 = this.discoveryClient.getInstances("service1").get(0);
assertThat(s1.getHost()).isEqualTo("s1-1");
assertThat(s1.getPort()).isEqualTo(8080);
assertThat(s1.getUri()).isEqualTo(URI.create("http://s1-1:8080"));
@@ -48,23 +48,22 @@ public class CompositeDiscoveryClientTests {
@Test
public void getServicesShouldAggregateAllServiceNames() {
assertThat(discoveryClient.getServices()).containsOnlyOnce("service1", "service2",
CUSTOM_SERVICE_ID);
assertThat(this.discoveryClient.getServices()).containsOnlyOnce("service1", "service2", "custom");
}
@Test
public void getDescriptionShouldBeComposite() {
assertThat(discoveryClient.description()).isEqualTo("Composite Discovery Client");
assertThat(this.discoveryClient.description()).isEqualTo("Composite Discovery Client");
}
@Test
public void getInstancesShouldRespectOrder() {
assertThat(discoveryClient.getInstances(CUSTOM_SERVICE_ID)).hasSize(1);
assertThat(discoveryClient.getInstances(CUSTOM_SERVICE_ID)).hasSize(1);
assertThat(this.discoveryClient.getInstances(CUSTOM_SERVICE_ID)).hasSize(1);
assertThat(this.discoveryClient.getInstances(CUSTOM_SERVICE_ID)).hasSize(1);
}
@Test
public void getInstancesByUnknownServiceIdShouldReturnAnEmptyList() {
assertThat(discoveryClient.getInstances("unknown")).hasSize(0);
assertThat(this.discoveryClient.getInstances("unknown")).hasSize(0);
}
}