HostName { String getHostNameFromEnv() { final String hostname; if (SystemUtils.isWindows()) { hostname = System.getenv(COMPUTER_NAME_PROPERTY); } else { hostname = System.getenv(HOSTNAME_PROPERTY); } return hostname; }  String determineHostName();  }
@Test @Parameters({MAC_OSX_NAME, LINUX_OS_NAME, SOLARIS_OS_NAME, WINDOWS_OS_NAME}) public void shouldBeNullIfEnvValueNotAvailableOnOS(String osName) throws IOException { setHostNamePropertiesNull(osName); String result = new HostName().getHostNameFromEnv(); assertThat(result).isEqualTo(null); }