Browse Source

Add Registration.getServiceId()

pull/169/head
Spencer Gibb 8 years ago
parent
commit
10a0d0f21e
No known key found for this signature in database
GPG Key ID: 7788A47380690861
  1. 5
      spring-cloud-commons/src/main/java/org/springframework/cloud/client/serviceregistry/Registration.java
  2. 4
      spring-cloud-commons/src/test/java/org/springframework/cloud/client/serviceregistry/AbstractAutoServiceRegistrationTests.java
  3. 4
      spring-cloud-commons/src/test/java/org/springframework/cloud/client/serviceregistry/endpoint/ServiceRegistryEndpointTests.java

5
spring-cloud-commons/src/main/java/org/springframework/cloud/client/serviceregistry/Registration.java

@ -4,4 +4,9 @@ package org.springframework.cloud.client.serviceregistry; @@ -4,4 +4,9 @@ package org.springframework.cloud.client.serviceregistry;
* @author Spencer Gibb
*/
public interface Registration {
/**
* @return the serviceId associated with this registration
*/
String getServiceId();
}

4
spring-cloud-commons/src/test/java/org/springframework/cloud/client/serviceregistry/AbstractAutoServiceRegistrationTests.java

@ -59,6 +59,10 @@ public class AbstractAutoServiceRegistrationTests { @@ -59,6 +59,10 @@ public class AbstractAutoServiceRegistrationTests {
}
public static class TestRegistration implements Registration {
@Override
public String getServiceId() {
return "testRegistration2";
}
}
public static class TestServiceRegistry implements ServiceRegistry<TestRegistration> {

4
spring-cloud-commons/src/test/java/org/springframework/cloud/client/serviceregistry/endpoint/ServiceRegistryEndpointTests.java

@ -72,6 +72,10 @@ public class ServiceRegistryEndpointTests { @@ -72,6 +72,10 @@ public class ServiceRegistryEndpointTests {
@Bean
Registration registration() {
return new Registration() {
@Override
public String getServiceId() {
return "testRegistration1";
}
};
}

Loading…
Cancel
Save