Testing for BindException cause as well
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
parent
35ea653f73
commit
9e84c1ee93
|
@ -34,6 +34,7 @@ import java.io.IOException;
|
|||
import java.io.InputStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.lang.reflect.Field;
|
||||
import java.net.BindException;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.ServerSocket;
|
||||
|
@ -318,6 +319,7 @@ public class ServerConnectorTest
|
|||
server.setHandler(handlers);
|
||||
|
||||
IOException x = assertThrows(IOException.class, () -> server.start());
|
||||
assertThat(x.getCause(), instanceOf(BindException.class));
|
||||
assertThat(x.getMessage(), containsString("0.0.0.0:" + port));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue