@ParameterizedTest
    @EnumSource(value = SessionProtocol.class, names = { "HTTP", "HTTPS" })
    void endpoints_customAuthority(SessionProtocol protocol) throws Exception {
        serverOne.start();

        // This test case will fail if the health check does not use an IP address
        // because the host name 'foo' does not really exist.
        final int port = serverOne.port(protocol);
        try (HealthCheckedEndpointGroup endpointGroup = build(
                HealthCheckedEndpointGroup.builder(
                        Endpoint.of("foo", port).withIpAddr("127.0.0.1"),
                        HEALTH_CHECK_PATH),
                protocol)) {

            endpointGroup.whenReady().join();
            endpointGroup.newMeterBinder("qux").bindTo(registry);

            assertThat(endpointGroup.endpoints())
                    .containsOnly(Endpoint.of("foo", port).withIpAddr("127.0.0.1"));

            assertThat(MoreMeters.measureAll(registry))
                    .containsEntry("armeria.client.endpoint.group.count#value{name=qux,state=healthy}", 1.0)
                    .containsEntry("armeria.client.endpoint.group.count#value{name=qux,state=unhealthy}",
                                   0.0)
                    .containsEntry("armeria.client.endpoint.group.healthy#value" +
                                   "{authority=foo:" + port + ",ip=127.0.0.1,name=qux}", 1.0);
        }
    }
When an endpoint has an IP address already, the health checker must send a health check request using
an IP address, because otherwise the health checker can send the health check request to a wrong host
if there are more than one IP addresses assigned to the host name.
core/src/test/java/com/linecorp/armeria/client/endpoint/healthcheck/HealthCheckedEndpointGroupIntegrationTest.java