Skip to content

Commit

Permalink
Merge pull request #21842 from ashanthamara/action-rest-api-remove
Browse files Browse the repository at this point in the history
Remove Update action authentication rest api related tests
  • Loading branch information
malithie authored Nov 28, 2024
2 parents 776dd67 + c6701a5 commit 4765f99
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,20 +187,6 @@ public void testUpdateActionWithInvalidID() {
.log().ifValidationFails()
.assertThat().statusCode(HttpStatus.SC_NOT_FOUND)
.body("description", equalTo("No Action is configured on the given Action Type and Id."));

// Update Action Endpoint Authentication Properties with an invalid action id.
AuthenticationTypeProperties authenticationType = new AuthenticationTypeProperties()
.properties(new HashMap<String, Object>() {{
put(TEST_ACCESS_TOKEN_AUTH_PROPERTY, TEST_ACCESS_TOKEN_AUTH_PROPERTY_VALUE);
}});

body = toJSONString(authenticationType);
Response responseOfPut = getResponseOfPut(ACTION_MANAGEMENT_API_BASE_PATH +
PRE_ISSUE_ACCESS_TOKEN_PATH + "/" + TEST_ACTION_INVALID_ID + ACTION_BEARER_AUTH_PATH, body);
responseOfPut.then()
.log().ifValidationFails()
.assertThat().statusCode(HttpStatus.SC_NOT_FOUND)
.body("description", equalTo("No Action is configured on the given Action Type and Id."));
}

@Test(dependsOnMethods = {"testUpdateActionWithInvalidID"})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,29 +395,7 @@ public void testCreateActionWithExtraEndpointAuthProperties() {
.statusCode(HttpStatus.SC_CREATED)
.body("endpoint.authentication.type", equalTo(AuthenticationType.TypeEnum.BASIC.toString()));

testActionId = responseOfPost.getBody().jsonPath().getString("id");
}

@Test(dependsOnMethods = {"testCreateActionWithExtraEndpointAuthProperties"})
public void testUpdateActionWithExtraEndpointAuthProperties() {

AuthenticationTypeProperties newAuthProperties = new AuthenticationTypeProperties()
.properties(new HashMap<String, Object>() {{
put(TEST_ACCESS_TOKEN_AUTH_PROPERTY, TEST_ACCESS_TOKEN_AUTH_PROPERTY_VALUE);
put(TEST_USERNAME_AUTH_PROPERTY, TEST_USERNAME_AUTH_PROPERTY_VALUE);
}});

String body = toJSONString(newAuthProperties);
Response responseOfPut = getResponseOfPut(ACTION_MANAGEMENT_API_BASE_PATH +
PRE_ISSUE_ACCESS_TOKEN_PATH + "/" + testActionId + ACTION_BEARER_AUTH_PATH, body);

responseOfPut.then()
.log().ifValidationFails()
.assertThat()
.statusCode(HttpStatus.SC_OK)
.body("endpoint.authentication.type", equalTo(AuthenticationType.TypeEnum.BEARER.toString()));

// Delete, created action.
deleteAction(PRE_ISSUE_ACCESS_TOKEN_PATH , testActionId);
deleteAction(PRE_ISSUE_ACCESS_TOKEN_PATH , responseOfPost.getBody().jsonPath().getString("id"));
}
}

0 comments on commit 4765f99

Please sign in to comment.