Minor improvement in AbstractKeycloakRule.stopServer()

This commit is contained in:
mposolda 2014-07-17 10:14:35 +02:00
parent 08b0aebe03
commit 0a15f873af

View file

@ -163,8 +163,9 @@ public abstract class AbstractKeycloakRule extends ExternalResource {
@Override
public void run() {
try {
new Socket(server.getConfig().getHost(), server.getConfig().getPort());
throw new RuntimeException();
Socket s = new Socket(server.getConfig().getHost(), server.getConfig().getPort());
s.close();
throw new IllegalStateException("Server still running");
} catch (IOException expected) {
}
}