@@ -93,8 +93,8 @@ public void should_not_register_instance_when_serviceId_is_ignored() {
9393@ Test
9494public void should_not_register_instance_when_instanceMetadata_is_ignored () {
9595when (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
9999this .listener .setIgnoredInstancesMetadata (Collections .singletonMap ("monitoring" , "false" ));
100100this .listener .onInstanceRegistered (new InstanceRegisteredEvent <>(new Object (), null ));
@@ -117,8 +117,8 @@ public void should_register_instance_when_serviceId_is_not_ignored() {
117117@ Test
118118public void should_register_instance_when_instanceMetadata_is_not_ignored () {
119119when (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
123123this .listener .setInstancesMetadata (Collections .singletonMap ("monitoring" , "false" ));
124124this .listener .onInstanceRegistered (new InstanceRegisteredEvent <>(new Object (), null ));
@@ -142,12 +142,14 @@ public void should_not_register_instance_when_serviceId_matches_ignored_pattern(
142142@ Test
143143public void should_not_register_instance_when_instanceMetadata_matches_ignored_metadata () {
144144when (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
152154this .listener .setIgnoredInstancesMetadata (Collections .singletonMap ("monitoring" , "false" ));
153155this .listener .onInstanceRegistered (new InstanceRegisteredEvent <>(new Object (), null ));
@@ -172,12 +174,14 @@ public void should_register_instances_when_serviceId_matches_wanted_pattern() {
172174@ Test
173175public void should_register_instances_when_instanceMetadata_matches_wanted_metadata () {
174176when (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
182186this .listener .setInstancesMetadata (Collections .singletonMap ("monitoring" , "true" ));
183187this .listener .onInstanceRegistered (new InstanceRegisteredEvent <>(new Object (), null ));
0 commit comments