@Test
	public void testContainerAttributesWithCustomContainerIpAndHostname() {

		final String customIp = "123.123.123.123";
		final String customHostname = "testhost";

		MockEnvironment environment = new MockEnvironment();
		environment.setProperty(CONTAINER_IP_KEY, customIp);
		environment.setProperty(CONTAINER_HOST_KEY, customHostname);

		final ContainerServerApplication containerServerApplication = new ContainerServerApplication();
		containerServerApplication.setEnvironment(environment);

		final ContainerAttributes containerAttributes = containerServerApplication.containerAttributes();
		Assert.assertNotNull(containerAttributes);
		Assert.assertEquals(customIp, containerAttributes.getIp());
		Assert.assertEquals(customHostname, containerAttributes.getHost());
	}
Helper class that bootstraps random configuration for dirt server applications.

@author Gunnar Hillert
spring-xd-dirt/src/test/java/org/springframework/xd/dirt/server/ContainerServerApplicationTests.java