@Test
	public void testDefaultContainerAttributes() {

		final String defaultIp = RuntimeUtils.getIpAddress();
		final String defaultHostname = RuntimeUtils.getHost();

		MockEnvironment environment = new MockEnvironment();

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

		final ContainerAttributes containerAttributes = containerServerApplication.containerAttributes();
		Assert.assertNotNull(containerAttributes);
		Assert.assertEquals(defaultIp, containerAttributes.getIp());
		Assert.assertEquals(defaultHostname, 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