Skip to content

Commit

Permalink
Fixes timeout param for certificates api and add tests
Browse files Browse the repository at this point in the history
Signed-off-by: Darshit Chanpura <[email protected]>
DarshitChanpura committed Aug 9, 2024

Verified

This commit was signed with the committer’s verified signature.
DarshitChanpura Darshit Chanpura
1 parent 5ab017a commit cc26b94
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -90,6 +90,17 @@ public void availableForRestAdmin() throws Exception {
withUser(REST_API_ADMIN_SSL_INFO, this::verifySSLCertsInfo);
}

@Test
public void timeoutTest() throws Exception {
withUser(REST_ADMIN_USER, this::verifyTimeoutRequest);
}

private void verifyTimeoutRequest(final TestRestClient client) throws Exception {
TestRestClient.HttpResponse response = ok(() -> client.get(sslCertsPath() + "?timeout=0"));
final var body = response.bodyAsJsonNode();
assertThat(body.get("nodes").size(), is(0));
}

private void verifySSLCertsInfo(final TestRestClient client) throws Exception {
assertSSLCertsInfo(
localCluster.nodes(),
Original file line number Diff line number Diff line change
@@ -71,6 +71,7 @@ protected CType getConfigType() {
protected void consumeParameters(RestRequest request) {
request.param("nodeId");
request.param("cert_type");
request.param("timeout");
}

private void securitySSLCertsRequestHandlers(RequestHandler.RequestHandlersBuilder requestHandlersBuilder) {

0 comments on commit cc26b94

Please sign in to comment.