IpUtil { public static URI createAmqpUri(final String host, final String exchange) { return createUri(AMQP_SCHEME, host).resolve("/" + exchange); } private  IpUtil(); static URI getClientIpFromRequest(final HttpServletRequest request,
            final HawkbitSecurityProperties securityProperties); static URI getClientIpFromRequest(final HttpServletRequest request, final String forwardHeader); static URI createUri(final String scheme, final String host); static URI createAmqpUri(final String host, final String exchange); static URI createHttpUri(final String host); static boolean isHttpUri(final URI uri); static boolean isAmqpUri(final URI uri); static boolean isIpAddresKnown(final URI uri);  }
@Test @Description("Tests create amqp uri ipv4 and ipv6") public void testCreateAmqpUri() { final String ipv4 = "10.99.99.1"; URI amqpUri = IpUtil.createAmqpUri(ipv4, "path"); assertAmqpUri(ipv4, amqpUri); final String host = "myhost"; amqpUri = IpUtil.createAmqpUri(host, "path"); assertAmqpUri(host, amqpUri); final String ipv6 = "0:0:0:0:0:0:0:1"; amqpUri = IpUtil.createAmqpUri(ipv6, "path"); assertAmqpUri("[" + ipv6 + "]", amqpUri); }