Test SOCKS4 client: no response to connect

This commit is contained in:
2021-01-22 21:34:41 +01:00
parent 3cdffcfa4c
commit 472f2776fb

View File

@@ -74,6 +74,20 @@ public class SOCKS4ClientTest {
assertArrayEquals(expectedByteStream.toByteArray(), ops.toByteArray());
}
/**
* Run into IOException while trying to connect due to no input/response
*/
@Test
public void connect__ioException() {
assertThrows(IOException.class, () -> {
SOCKS4Client.connect(
new ByteArrayInputStream(new byte[]{}),
new ByteArrayOutputStream(),
"127.0.0.1",
80);
});
}
/**
* IPv6 is not supported by this SOCKS client so it just throws an exception
*/