* @throws Exception should not happen
*/
@Test
public void shouldRespondWithErrorIfNoSupportedAuthenticationMethod() throws Exception {
SmackConfiguration.setLocalSocks5ProxyPort(7890);
Socks5Proxy proxy = Socks5Proxy.getSocks5Proxy();
proxy.start();
Socket socket = new Socket(proxy.getLocalAddresses().get(0), proxy.getPort());
OutputStream out = socket.getOutputStream();
// request username/password-authentication
out.write(new byte[] { (byte) 0x05, (byte) 0x01, (byte) 0x02 });
InputStream in = socket.getInputStream();
assertEquals((byte) 0x05, (byte) in.read());
assertEquals((byte) 0xFF, (byte) in.read());
assertEquals(-1, in.read());
proxy.stop();
}