Add Registration.getServiceId()

This commit is contained in:
Spencer Gibb
2017-02-01 13:12:11 -07:00
parent ba3dd0967a
commit 10a0d0f21e
3 changed files with 13 additions and 0 deletions

View File

@@ -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();
}

View File

@@ -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> {

View File

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