@SuppressWarnings("unchecked")
	@Test
	void eurekaClientGetStatus() {
		EurekaServiceRegistry registry = new EurekaServiceRegistry();

		EurekaInstanceConfigBean config = new EurekaInstanceConfigBean(new InetUtils(new InetUtilsProperties()));
		config.setAppname("myapp");
		config.setInstanceId("1234");

		InstanceInfo local = InstanceInfo.Builder.newBuilder()
			.setAppName("myapp")
			.setInstanceId("1234")
			.setStatus(DOWN)
			.build();

		InstanceInfo remote = InstanceInfo.Builder.newBuilder()
			.setAppName("myapp")
			.setInstanceId("1234")
			.setStatus(DOWN)
			.setOverriddenStatus(OUT_OF_SERVICE)
			.build();

		CloudEurekaClient eurekaClient = mock(CloudEurekaClient.class);
		when(eurekaClient.getInstanceInfo(local.getAppName(), local.getId())).thenReturn(remote);

		ApplicationInfoManager applicationInfoManager = mock(ApplicationInfoManager.class);
		when(applicationInfoManager.getInfo()).thenReturn(local);

		EurekaRegistration registration = EurekaRegistration.builder(config)
			.with(eurekaClient)
			.with(applicationInfoManager)
			.with(new EurekaClientConfigBean(), mock(ApplicationEventPublisher.class))
			.build();

		Object status = registry.getStatus(registration);

		assertThat(registration.getInstanceId()).isEqualTo("1234");

		assertThat(status).isInstanceOf(Map.class);

		Map<Object, Object> map = (Map<Object, Object>) status;

		assertThat(map).hasSize(2)
			.containsEntry("status", DOWN.toString())
			.containsEntry("overriddenStatus", OUT_OF_SERVICE.toString());
	}
@author Spencer Gibb
@author Tim Ysewyn
@author Robert Bleyl
spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/serviceregistry/EurekaServiceRegistryTests.java