Skip to content

Commit

Permalink
Improve integration tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thisara-Welmilla committed Jan 24, 2025
1 parent 87022e1 commit 7be795c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,23 @@ protected Response getResponseOfGet(String endpointUri) {
.get(endpointUri);
}

/**
* Invoke given endpointUri for GET with Basic authentication, authentication credential being the
* authenticatingUserName and authenticatingCredential with no filter.
*
* @param endpointUri endpoint to be invoked
* @return response
*/
protected Response getResponseOfGetNoFilter(String endpointUri) {

return given().auth().preemptive().basic(authenticatingUserName, authenticatingCredential)
.contentType(ContentType.JSON)
.header(HttpHeaders.ACCEPT, ContentType.JSON)
.log().ifValidationFails()
.when()
.get(endpointUri);
}

/**
* Invoke given endpointUri for GET with Basic authentication, authentication credential being the
* authenticatingUserName and authenticatingCredential
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public void testValidateCustomTagInGetMetaTags() {
@Test(dependsOnMethods = {"testCreateUserDefinedLocalAuthenticator"})
public void testGetUserDefinedLocalAuthenticator() {

Response response = getResponseOfGet(AUTHENTICATOR_CONFIG_API_BASE_PATH + customIdPId);
Response response = getResponseOfGetNoFilter(AUTHENTICATOR_CONFIG_API_BASE_PATH + customIdPId);
response.then()
.log().ifValidationFails()
.assertThat()
Expand Down

0 comments on commit 7be795c

Please sign in to comment.