@Override
	public void run(EnhancedPluginContext context) throws Throwable {
		if (!this.reportProperties.isEnabled()) {
			return;
		}
		EnhancedRequestContext request = context.getRequest();
		EnhancedResponseContext response = context.getResponse();
		ServiceInstance serviceInstance = Optional.ofNullable(context.getTargetServiceInstance()).orElse(new DefaultServiceInstance());

		ResourceStat resourceStat = PolarisEnhancedPluginUtils.createInstanceResourceStat(
				serviceInstance.getServiceId(),
				serviceInstance.getHost(),
				serviceInstance.getPort(),
				request.getUrl(),
				response.getHttpStatus(),
				context.getDelay(),
				null
		);

		LOG.debug("Will report CircuitBreaker ResourceStat of {}. Request=[{} {}]. Response=[{}]. Delay=[{}]ms.",
				resourceStat.getRetStatus().name(), request.getHttpMethod().name(), request.getUrl().getPath(), response.getHttpStatus(), context.getDelay());

		circuitBreakAPI.report(resourceStat);
	}
@Test
	public void testRun() throws Throwable {

		EnhancedPluginContext context = mock(EnhancedPluginContext.class);
		// test not report
		successCircuitBreakerReporter.run(context);
		verify(context, times(0)).getRequest();

		doReturn(true).when(reporterProperties).isEnabled();

		EnhancedPluginContext pluginContext = new EnhancedPluginContext();
		EnhancedRequestContext request = EnhancedRequestContext.builder()
				.httpMethod(HttpMethod.GET)
				.url(URI.create("http://0.0.0.0/"))
				.build();
		EnhancedResponseContext response = EnhancedResponseContext.builder()
				.httpStatus(200)
				.build();
		DefaultServiceInstance serviceInstance = new DefaultServiceInstance();
		serviceInstance.setServiceId(SERVICE_PROVIDER);

		pluginContext.setRequest(request);
		pluginContext.setResponse(response);
		pluginContext.setTargetServiceInstance(serviceInstance, null);

		successCircuitBreakerReporter.run(pluginContext);
		successCircuitBreakerReporter.getOrder();
		successCircuitBreakerReporter.getName();
		successCircuitBreakerReporter.getType();
	}