From bf27081a88f4036eea2ae0cad64cf09363094a9f Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 26 Sep 2023 21:50:45 +0800 Subject: [PATCH] Fix #1240. (#1241) --- .../ROOT/pages/spring-cloud-commons/common-abstractions.adoc | 4 ++-- .../endpoint/ServiceRegistryEndpointNoRegistrationTests.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/modules/ROOT/pages/spring-cloud-commons/common-abstractions.adoc b/docs/modules/ROOT/pages/spring-cloud-commons/common-abstractions.adoc index 20dbfc7e..3c5a2012 100644 --- a/docs/modules/ROOT/pages/spring-cloud-commons/common-abstractions.adoc +++ b/docs/modules/ROOT/pages/spring-cloud-commons/common-abstractions.adoc @@ -126,9 +126,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. -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. 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. diff --git a/spring-cloud-commons/src/test/java/org/springframework/cloud/client/serviceregistry/endpoint/ServiceRegistryEndpointNoRegistrationTests.java b/spring-cloud-commons/src/test/java/org/springframework/cloud/client/serviceregistry/endpoint/ServiceRegistryEndpointNoRegistrationTests.java index 7e91a616..53806573 100644 --- a/spring-cloud-commons/src/test/java/org/springframework/cloud/client/serviceregistry/endpoint/ServiceRegistryEndpointNoRegistrationTests.java +++ b/spring-cloud-commons/src/test/java/org/springframework/cloud/client/serviceregistry/endpoint/ServiceRegistryEndpointNoRegistrationTests.java @@ -48,12 +48,12 @@ public class ServiceRegistryEndpointNoRegistrationTests { @Test 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 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()); }