@CanDistro
    @DeleteMapping
    @TpsControl(pointName = "NamingInstanceDeregister", name = "HttpNamingInstanceDeregister")
    @Secured(action = ActionTypes.WRITE)
    public Result<String> deregister(InstanceForm instanceForm) throws NacosException {
        // check param
        instanceForm.validate();
        checkWeight(instanceForm.getWeight());
        // build instance
        Instance instance = buildInstance(instanceForm);
        instanceServiceV2.removeInstance(instanceForm.getNamespaceId(), buildCompositeServiceName(instanceForm),
                instance);
        NotifyCenter.publishEvent(
                new DeregisterInstanceTraceEvent(System.currentTimeMillis(), NamingRequestUtil.getSourceIp(), false,
                        DeregisterInstanceReason.REQUEST, instanceForm.getNamespaceId(), instanceForm.getGroupName(),
                        instanceForm.getServiceName(), instance.getIp(), instance.getPort()));
        return Result.success("ok");
    }
@Test
    void deregisterInstance() throws Exception {
        
        InstanceForm instanceForm = new InstanceForm();
        instanceForm.setNamespaceId(TEST_NAMESPACE);
        instanceForm.setGroupName("DEFAULT_GROUP");
        instanceForm.setServiceName("test-service");
        instanceForm.setIp(TEST_IP);
        instanceForm.setClusterName(TEST_CLUSTER_NAME);
        instanceForm.setPort(9999);
        instanceForm.setHealthy(true);
        instanceForm.setWeight(1.0);
        instanceForm.setEnabled(true);
        instanceForm.setMetadata(TEST_METADATA);
        instanceForm.setEphemeral(true);
        
        Result<String> result = instanceControllerV2.deregister(instanceForm);
        
        verify(instanceServiceV2).removeInstance(eq(TEST_NAMESPACE), eq(TEST_SERVICE_NAME), any());
        
        assertEquals(ErrorCode.SUCCESS.getCode(), result.getCode());
        assertEquals("ok", result.getData());
        
    }