@Test
	void refreshHostName() {
		TestPropertyValues.of("eureka.instance.appGroupName=mygroup").applyTo(this.context);
		setupContext();
		ReflectionTestUtils.setField(getInstanceConfig(), "hostname", "marvin");
		assertThat(getInstanceConfig().getHostname()).isEqualTo("marvin");
		getInstanceConfig().getHostName(true);
		if (this.hostName != null) {
			assertThat(getInstanceConfig().getHostname()).isEqualTo(this.hostName);
		}
	}
@author Dave Syer
@author Spencer Gibb
@author Ryan Baxter
@author Tim Ysewyn
spring-cloud-netflix-eureka-client/src/test/java/org/springframework/cloud/netflix/eureka/EurekaInstanceConfigBeanTests.java