Browse Source

Fix endpoint reference. Based on gh-1241.

4.0.x
Olga MaciaszekSharma 1 year ago
parent
commit
5c6b7bac56
  1. 4
      docs/src/main/asciidoc/spring-cloud-commons.adoc
  2. 4
      spring-cloud-commons/src/test/java/org/springframework/cloud/client/serviceregistry/endpoint/ServiceRegistryEndpointNoRegistrationTests.java

4
docs/src/main/asciidoc/spring-cloud-commons.adoc

@ -375,9 +375,9 @@ NOTE: These events will not be fired if the `spring.cloud.service-registry.auto-
==== Service Registry Actuator Endpoint ==== Service Registry Actuator Endpoint
Spring Cloud Commons provides a `/service-registry` actuator endpoint. Spring Cloud Commons provides a `/serviceregistry` actuator endpoint.
This endpoint relies on a `Registration` bean in the Spring Application Context. This endpoint relies on a `Registration` bean in the Spring Application Context.
Calling `/service-registry` with GET returns the status of the `Registration`. Calling `/serviceregistry` with GET returns the status of the `Registration`.
Using POST to the same endpoint with a JSON body changes the status of the current `Registration` to the new value. Using POST to the same endpoint with a JSON body changes the status of the current `Registration` to the new value.
The JSON body has to include the `status` field with the preferred value. The JSON body has to include the `status` field with the preferred value.
Please see the documentation of the `ServiceRegistry` implementation you use for the allowed values when updating the status and the values returned for the status. Please see the documentation of the `ServiceRegistry` implementation you use for the allowed values when updating the status and the values returned for the status.

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

@ -48,12 +48,12 @@ public class ServiceRegistryEndpointNoRegistrationTests {
@Test @Test
public void testGet() throws Exception { public void testGet() throws Exception {
this.mvc.perform(get("/service-registry/instance-status")).andExpect(status().isNotFound()); this.mvc.perform(get("/serviceregistry/instance-status")).andExpect(status().isNotFound());
} }
@Test @Test
public void testPost() throws Exception { public void testPost() throws Exception {
this.mvc.perform(post("/service-registry/instance-status").content("newstatus")) this.mvc.perform(post("/serviceregistry/instance-status").content("newstatus"))
.andExpect(status().isNotFound()); .andExpect(status().isNotFound());
} }

Loading…
Cancel
Save