@PutMapping
    @Secured(action = ActionTypes.WRITE)
    public String update(HttpServletRequest request) throws Exception {
        final String namespaceId = WebUtils
                .optional(request, CommonParams.NAMESPACE_ID, Constants.DEFAULT_NAMESPACE_ID);
        final String clusterName = WebUtils.required(request, CommonParams.CLUSTER_NAME);
        final String serviceName = WebUtils.required(request, CommonParams.SERVICE_NAME);
        ClusterMetadata clusterMetadata = new ClusterMetadata();
        clusterMetadata.setHealthyCheckPort(NumberUtils.toInt(WebUtils.required(request, "checkPort")));
        clusterMetadata.setUseInstancePortForCheck(
                ConvertUtils.toBoolean(WebUtils.required(request, "useInstancePort4Check")));
        AbstractHealthChecker healthChecker = HealthCheckerFactory
                .deserialize(WebUtils.required(request, "healthChecker"));
        clusterMetadata.setHealthChecker(healthChecker);
        clusterMetadata.setHealthyCheckType(healthChecker.getType());
        clusterMetadata.setExtendData(
                UtilsAndCommons.parseMetadata(WebUtils.optional(request, "metadata", StringUtils.EMPTY)));
        judgeClusterOperator().updateClusterMetadata(namespaceId, serviceName, clusterName, clusterMetadata);
        return "ok";
    }
@Test
    void testUpdate() throws Exception {
        mockRequestParameter(CommonParams.NAMESPACE_ID, "test-namespace");
        mockRequestParameter(CommonParams.CLUSTER_NAME, TEST_CLUSTER_NAME);
        mockRequestParameter(CommonParams.SERVICE_NAME, TEST_SERVICE_NAME);
        mockRequestParameter("checkPort", "1");
        mockRequestParameter("useInstancePort4Check", "true");
        mockRequestParameter("healthChecker", "{\"type\":\"HTTP\"}");
        assertEquals("ok", clusterController.update(request));
        verify(clusterOperatorV2).updateClusterMetadata(eq("test-namespace"), eq(TEST_SERVICE_NAME), eq(TEST_CLUSTER_NAME),
                any(ClusterMetadata.class));
    }