Skip to content

Commit 5b5212b

Browse files
committed
fix formatting
1 parent ed0b42d commit 5b5212b

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

spring-boot-admin-server-cloud/src/test/java/de/codecentric/boot/admin/server/cloud/discovery/InstanceDiscoveryListenerTest.java

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ public void should_not_register_instance_when_serviceId_is_ignored() {
9393
@Test
9494
public void should_not_register_instance_when_instanceMetadata_is_ignored() {
9595
when(this.discovery.getServices()).thenReturn(singletonList("service"));
96-
when(this.discovery.getInstances("service")).thenReturn(singletonList(new DefaultServiceInstance("test-1", "service",
97-
"localhost", 80, false, Collections.singletonMap("monitoring", "false"))));
96+
when(this.discovery.getInstances("service")).thenReturn(singletonList(new DefaultServiceInstance("test-1",
97+
"service", "localhost", 80, false, Collections.singletonMap("monitoring", "false"))));
9898

9999
this.listener.setIgnoredInstancesMetadata(Collections.singletonMap("monitoring", "false"));
100100
this.listener.onInstanceRegistered(new InstanceRegisteredEvent<>(new Object(), null));
@@ -117,8 +117,8 @@ public void should_register_instance_when_serviceId_is_not_ignored() {
117117
@Test
118118
public void should_register_instance_when_instanceMetadata_is_not_ignored() {
119119
when(this.discovery.getServices()).thenReturn(singletonList("service"));
120-
when(this.discovery.getInstances("service")).thenReturn(singletonList(new DefaultServiceInstance("test-1", "service",
121-
"localhost", 80, false, Collections.singletonMap("monitoring", "true"))));
120+
when(this.discovery.getInstances("service")).thenReturn(singletonList(new DefaultServiceInstance("test-1",
121+
"service", "localhost", 80, false, Collections.singletonMap("monitoring", "true"))));
122122

123123
this.listener.setInstancesMetadata(Collections.singletonMap("monitoring", "false"));
124124
this.listener.onInstanceRegistered(new InstanceRegisteredEvent<>(new Object(), null));
@@ -142,12 +142,14 @@ public void should_not_register_instance_when_serviceId_matches_ignored_pattern(
142142
@Test
143143
public void should_not_register_instance_when_instanceMetadata_matches_ignored_metadata() {
144144
when(this.discovery.getServices()).thenReturn(asList("service", "rabbit-1", "rabbit-2"));
145-
when(this.discovery.getInstances("service")).thenReturn(singletonList(new DefaultServiceInstance("test-1", "service",
146-
"localhost", 80, false, Collections.singletonMap("monitoring", "true"))));
147-
when(this.discovery.getInstances("rabbit-1")).thenReturn(singletonList(new DefaultServiceInstance("rabbit-test-1",
148-
"rabbit-1", "localhost", 80, false, Collections.singletonMap("monitoring", "false"))));
149-
when(this.discovery.getInstances("rabbit-2")).thenReturn(singletonList(new DefaultServiceInstance("rabbit-test-1",
150-
"rabbit-2", "localhost", 80, false, Collections.singletonMap("monitoring", "false"))));
145+
when(this.discovery.getInstances("service")).thenReturn(singletonList(new DefaultServiceInstance("test-1",
146+
"service", "localhost", 80, false, Collections.singletonMap("monitoring", "true"))));
147+
when(this.discovery.getInstances("rabbit-1"))
148+
.thenReturn(singletonList(new DefaultServiceInstance("rabbit-test-1", "rabbit-1", "localhost", 80,
149+
false, Collections.singletonMap("monitoring", "false"))));
150+
when(this.discovery.getInstances("rabbit-2"))
151+
.thenReturn(singletonList(new DefaultServiceInstance("rabbit-test-1", "rabbit-2", "localhost", 80,
152+
false, Collections.singletonMap("monitoring", "false"))));
151153

152154
this.listener.setIgnoredInstancesMetadata(Collections.singletonMap("monitoring", "false"));
153155
this.listener.onInstanceRegistered(new InstanceRegisteredEvent<>(new Object(), null));
@@ -172,12 +174,14 @@ public void should_register_instances_when_serviceId_matches_wanted_pattern() {
172174
@Test
173175
public void should_register_instances_when_instanceMetadata_matches_wanted_metadata() {
174176
when(this.discovery.getServices()).thenReturn(asList("service", "rabbit-1", "rabbit-2"));
175-
when(this.discovery.getInstances("service")).thenReturn(singletonList(new DefaultServiceInstance("test-1", "service",
176-
"localhost", 80, false, Collections.singletonMap("monitoring", "true"))));
177-
when(this.discovery.getInstances("rabbit-1")).thenReturn(singletonList(new DefaultServiceInstance("rabbit-test-1",
178-
"rabbit-1", "localhost", 80, false, Collections.singletonMap("monitoring", "false"))));
179-
when(this.discovery.getInstances("rabbit-2")).thenReturn(singletonList(new DefaultServiceInstance("rabbit-test-1",
180-
"rabbit-2", "localhost", 80, false, Collections.singletonMap("monitoring", "false"))));
177+
when(this.discovery.getInstances("service")).thenReturn(singletonList(new DefaultServiceInstance("test-1",
178+
"service", "localhost", 80, false, Collections.singletonMap("monitoring", "true"))));
179+
when(this.discovery.getInstances("rabbit-1"))
180+
.thenReturn(singletonList(new DefaultServiceInstance("rabbit-test-1", "rabbit-1", "localhost", 80,
181+
false, Collections.singletonMap("monitoring", "false"))));
182+
when(this.discovery.getInstances("rabbit-2"))
183+
.thenReturn(singletonList(new DefaultServiceInstance("rabbit-test-1", "rabbit-2", "localhost", 80,
184+
false, Collections.singletonMap("monitoring", "false"))));
181185

182186
this.listener.setInstancesMetadata(Collections.singletonMap("monitoring", "true"));
183187
this.listener.onInstanceRegistered(new InstanceRegisteredEvent<>(new Object(), null));

0 commit comments

Comments
 (0)