Add Registration.getServiceId()
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -72,6 +72,10 @@ public class ServiceRegistryEndpointTests {
|
||||
@Bean
|
||||
Registration registration() {
|
||||
return new Registration() {
|
||||
@Override
|
||||
public String getServiceId() {
|
||||
return "testRegistration1";
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user