Skip to content

Commit

Permalink
Close http clients used in rest clients
Browse files Browse the repository at this point in the history
  • Loading branch information
Shenali-SJ committed Sep 5, 2024
1 parent 982cf94 commit f7f828c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,11 @@ public void atEnd() throws Exception {
deleteApp(applicationId);
deleteDomainAPI(domainAPIId);
scim2RestClient.deleteUser(userId);
scim2RestClient = null;
MockServer.shutDownMockServer();
restClient.closeHttpClient();
scim2RestClient.closeHttpClient();
actionsRestClient.closeHttpClient();
client.close();
accessToken = null;
jwtClaims = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,10 @@ public void atEnd() throws Exception {
deleteApp(applicationId);
deleteDomainAPI(domainAPIId);
scim2RestClient.deleteUser(userId);
scim2RestClient = null;
MockServer.shutDownMockServer();
restClient.closeHttpClient();
scim2RestClient.closeHttpClient();
actionsRestClient.closeHttpClient();
accessToken = null;
jwtClaims = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,14 @@ private Header[] getHeaders() {

return headerList;
}

/**
* Close the HTTP client.
*
* @throws IOException If an error occurred while closing the Http Client.
*/
public void closeHttpClient() throws IOException {

client.close();
}
}

0 comments on commit f7f828c

Please sign in to comment.