@Test
public void expectBlockedHostIsBlocked() {

    // test if a host that resolves to blocked address (hardcoded e.g. loopback, not configured) is blocked
    final String theHost = "eclipse.org";
    // required because empty blocklist disables verification
    when(connectionConfig.getBlockedHostnames()).thenReturn(List.of("dummy.org"));
    // eclipse.org resolves to loopback which is blocked
    final HostValidator.AddressResolver resolveToLoopback =
            host -> resolveHost(theHost, InetAddress.getLoopbackAddress().getAddress());
    final HostValidator underTest = getHostValidatorWithCustomResolver(resolveToLoopback);
    final HostValidationResult validationResult = underTest.validateHost(theHost);
    assertThat(validationResult.isValid()).isFalse();
}