Copilot commented on code in PR #789:
URL:
https://github.com/apache/rocketmq-dashboard/pull/789#discussion_r3701707543
##########
server/src/test/java/org/apache/rocketmq/studio/ops/OpsControllerTest.java:
##########
@@ -81,6 +83,22 @@ void updateNameSvrAddrShouldDelegateToService() throws
Exception {
verify(opsService).updateNameServer(eq("10.0.0.1:9876"));
}
+ @Test
+ void updateNameSvrAddrShouldReturnUnavailableWhenServiceRejects() throws
Exception {
+ doThrow(new BusinessException(501, "Ops settings are not connected to
the cluster admin configuration"))
+ .when(opsService).updateNameServer("10.0.0.1:9876");
+
Review Comment:
Only `/api/ops/updateNameSvrAddr` has a controller-level test asserting the
new 501/Not Implemented behavior. Since this PR intends *all* Ops write
endpoints to be unavailable, it would be good to add similar
`BusinessException(501, ...)` coverage for the other write endpoints
(`/addNameSvrAddr`, `/deleteNameSvrAddr`, `/updateIsVIPChannel`,
`/updateUseTLS`) so regressions in exception mapping or endpoint wiring are
caught.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]