@Test
@SuppressWarnings("ConstantConditions")
public void openInvalidInput() {

    // Invalid slash count after scheme.
    assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() ->
            DefaultDockerClient.newInstance(createConfig(URI.create("tcp:/127.0.0.1:2375"), false)));
    assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() ->
            DefaultDockerClient.newInstance(createConfig(URI.create("tcp:///127.0.0.1:2375"), false)));
    // With path.
    assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() ->
            DefaultDockerClient.newInstance(createConfig(URI.create("tcp://127.0.0.1:2375/blah"), false)));
    // With query.
    assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() ->
            DefaultDockerClient.newInstance(createConfig(URI.create("tcp://127.0.0.1:2375?param=value"), false)));
    // Invalid hostname
    assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() ->
            DefaultDockerClient.newInstance(createConfig(URI.create("tcp://127..0.0.1:2375"), false)));
}