Skip to content

Commit

Permalink
address already in use fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Raul committed Sep 4, 2024
1 parent 8b9111c commit 0b9a258
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public void detect_weakCredentialsExist_returnsAllWeakCredentials() throws Excep
tester.testValidCredentials(
targetNetworkService, ImmutableList.of(WEAK_CRED_1, WEAK_CRED_2)))
.containsExactly(WEAK_CRED_1, WEAK_CRED_2);
ajpTestServer.stop();
}

@Test
Expand All @@ -147,6 +148,7 @@ public void detect_noWeakCredentials_returnsNoCredentials() throws Exception {

assertThat(tester.testValidCredentials(targetNetworkService, ImmutableList.of(WRONG_CRED_1)))
.isEmpty();
ajpTestServer.stop();
}

private static byte[] createAjpUnauthorizedResponse() {
Expand Down Expand Up @@ -191,7 +193,6 @@ public void start() throws IOException {
os.flush();

} catch (IOException e) {
System.err.println("An error occurred in AjpTestServer.");
e.printStackTrace();
}
}
Expand All @@ -201,7 +202,7 @@ public void start() throws IOException {

public void stop() throws IOException {
running = false;
if (serverSocket != null && !serverSocket.isClosed()) {
if (serverSocket != null) {
serverSocket.close();
}
}
Expand Down

0 comments on commit 0b9a258

Please sign in to comment.