public static ResourceStat createInstanceResourceStat(
			@Nullable String calleeServiceName, @Nullable String calleeHost, @Nullable Integer calleePort,
			URI uri, @Nullable Integer statusCode, long delay, @Nullable Throwable exception) {
		ServiceKey calleeServiceKey = new ServiceKey(MetadataContext.LOCAL_NAMESPACE, StringUtils.isBlank(calleeServiceName) ? uri.getHost() : calleeServiceName);
		ServiceKey callerServiceKey = new ServiceKey(MetadataContext.LOCAL_NAMESPACE, MetadataContext.LOCAL_SERVICE);
		Resource resource = new InstanceResource(
				calleeServiceKey,
				StringUtils.isBlank(calleeHost) ? uri.getHost() : calleeHost,
				calleePort == null ? getPort(uri) : calleePort,
				callerServiceKey
		);
		return new ResourceStat(resource, statusCode == null ? -1 : statusCode, delay, getDefaultRetStatus(statusCode, exception));
	}
@Test
	public void testResourceStat() throws URISyntaxException {

		ResourceStat resourceStat;

		resourceStat = PolarisEnhancedPluginUtils.createInstanceResourceStat("test",
				null,
				null,
				new URI("http://0.0.0.0/"),
				200,
				0,
				null
		);
		assertThat(resourceStat.getRetStatus()).isEqualTo(RetStatus.RetSuccess);

		resourceStat = PolarisEnhancedPluginUtils.createInstanceResourceStat("test",
				null,
				null,
				new URI("http://0.0.0.0/"),
				null,
				0,
				new SocketTimeoutException()
		);
		assertThat(resourceStat.getRetStatus()).isEqualTo(RetStatus.RetTimeout);

		resourceStat = PolarisEnhancedPluginUtils.createInstanceResourceStat("test",
				null,
				null,
				new URI("http://0.0.0.0/"),
				200,
				0,
				null
		);
		assertThat(resourceStat.getRetStatus()).isEqualTo(RetStatus.RetSuccess);
	}