Browse Source

fix Endpoint ID 'service-registry' contains invalid characters, please migrate to a valid format (#701)

pull/732/head
Nikita Konev 5 years ago committed by GitHub
parent
commit
333779070f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      spring-cloud-commons/src/main/java/org/springframework/cloud/client/serviceregistry/endpoint/ServiceRegistryEndpoint.java
  2. 4
      spring-cloud-commons/src/test/java/org/springframework/cloud/client/serviceregistry/endpoint/ServiceRegistryEndpointTests.java

2
spring-cloud-commons/src/main/java/org/springframework/cloud/client/serviceregistry/endpoint/ServiceRegistryEndpoint.java

@ -31,7 +31,7 @@ import org.springframework.util.Assert; @@ -31,7 +31,7 @@ import org.springframework.util.Assert;
* @author Spencer Gibb
*/
@SuppressWarnings("unchecked")
@Endpoint(id = "service-registry")
@Endpoint(id = "serviceregistry")
public class ServiceRegistryEndpoint {
private final ServiceRegistry serviceRegistry;

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

@ -71,14 +71,14 @@ public class ServiceRegistryEndpointTests { @@ -71,14 +71,14 @@ public class ServiceRegistryEndpointTests {
@Test
public void testGet() throws Exception {
this.mvc.perform(get(BASE_PATH + "/service-registry")).andExpect(status().isOk())
this.mvc.perform(get(BASE_PATH + "/serviceregistry")).andExpect(status().isOk())
.andExpect(content().string(containsString(MYSTATUS)));
}
@Test
public void testPost() throws Exception {
Map<String, String> status = Collections.singletonMap("status", UPDATED_STATUS);
this.mvc.perform(post(BASE_PATH + "/service-registry")
this.mvc.perform(post(BASE_PATH + "/serviceregistry")
.content(new ObjectMapper().writeValueAsString(status))
.contentType(MediaType.APPLICATION_JSON)).andExpect(status().isOk());
then(this.serviceRegistry.getUpdatedStatus().get()).isEqualTo(UPDATED_STATUS);

Loading…
Cancel
Save