ManagementClient implements Closeable { static String formatIP(String ip) { if (ip.contains(":") && ip.contains("%")) { ip = ip.split("%")[0]; } if (ip.equals("0.0.0.0")) { logger.debug("WildFly is bound to 0.0.0.0 which is correct, setting client to 127.0.0.1"); ip = "127.0.0.1"; } return ip; } ManagementClient(ModelControllerClient client, final String mgmtAddress, final int managementPort, final String protocol);  ManagementClient(ModelControllerClient client, final CommonContainerConfiguration config); ModelControllerClient getControllerClient(); URI getWebUri(); ProtocolMetaData getProtocolMetaData(String deploymentName); boolean isServerInRunningState(); boolean isClosed(); @Override void close(); JMXServiceURL getRemoteJMXURL(); int getMgmtPort(); String getMgmtAddress(); String getMgmtProtocol(); URI getRemoteEjbURL();  }
@Test public void shouldParseBindAllAsLocalhost() { String sourceIp = "0.0.0.0"; String parsedIp = ManagementClient.formatIP(sourceIp); Assert.assertEquals("127.0.0.1", parsedIp); }
@Test public void shouldParseLocalIPAsNormalIP() { String sourceIp = "10.1.2.3"; String formattedIp = ManagementClient.formatIP(sourceIp); Assert.assertEquals(sourceIp, formattedIp); }