@Override
	public void deregister(PolarisRegistration registration) {
		LOGGER.info("De-registering from Polaris Server now...");

		if (StringUtils.isEmpty(registration.getServiceId()) || !PolarisSDKContextManager.isRegistered) {
			LOGGER.warn("No dom to de-register for polaris client...");
			return;
		}

		InstanceDeregisterRequest deRegisterRequest = new InstanceDeregisterRequest();
		deRegisterRequest.setToken(polarisDiscoveryProperties.getToken());
		deRegisterRequest.setNamespace(polarisDiscoveryProperties.getNamespace());
		deRegisterRequest.setService(registration.getServiceId());
		deRegisterRequest.setHost(registration.getHost());
		deRegisterRequest.setPort(registration.getPort());

		try {
			ProviderAPI providerClient = polarisSDKContextManager.getProviderAPI();
			providerClient.deRegister(deRegisterRequest);
			PolarisSDKContextManager.isRegistered = false;
			LOGGER.info("De-registration finished.");
		}
		catch (Exception e) {
			LOGGER.error("ERR_POLARIS_DEREGISTER, de-register failed...{},", registration, e);
		}
		finally {
			if (null != heartbeatExecutor) {
				heartbeatExecutor.shutdown();
			}
		}
	}
@Test
	public void testDeRegister() {
		this.contextRunner.run(context -> {
			PolarisServiceRegistry registry = context.getBean(PolarisServiceRegistry.class);
			PolarisRegistration registration = Mockito.mock(PolarisRegistration.class);
			doReturn(null).when(registration).getServiceId();
			assertThatCode(() -> {
				registry.deregister(registration);
			}).doesNotThrowAnyException();
		});
	}