Skip to content

Commit

Permalink
Merge pull request #22023 from ashanthamara/action-refactor
Browse files Browse the repository at this point in the history
Modify deleteAction rest api tests
  • Loading branch information
ashanthamara authored Dec 12, 2024
2 parents c365b68 + 7037e45 commit e48250f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@
*/
public class ActionsFailureTest extends ActionsTestBase {

private static final String TEST_USERNAME_INVALID_AUTH_PROPERTY = "invalidUsername";
private static final String TEST_ACTION_INVALID_ID = "invalid_id";
private static ActionModel action1;
private static ActionModel action2;
private static String testActionId2;
Expand Down Expand Up @@ -222,18 +220,6 @@ public void testDeactivateActionWithInvalidID() {
.assertThat()
.statusCode(HttpStatus.SC_NOT_FOUND)
.body("description", equalTo("No Action is configured on the given Action Type and Id."));
}

@Test(dependsOnMethods = {"testDeactivateActionWithInvalidID"})
public void testDeleteActionWithInvalidID() {

getResponseOfDelete(ACTION_MANAGEMENT_API_BASE_PATH + PRE_ISSUE_ACCESS_TOKEN_PATH +
"/" + TEST_ACTION_INVALID_ID)
.then()
.log().ifValidationFails()
.assertThat()
.statusCode(HttpStatus.SC_NOT_FOUND)
.body("description", equalTo("No Action is configured on the given Action Type and Id."));

// Delete, created action.
deleteAction(PRE_ISSUE_ACCESS_TOKEN_PATH , testActionId2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,17 @@ public void testDeleteAction() {
}

@Test(dependsOnMethods = {"testDeleteAction"})
public void testDeleteNonExistingAction() {

getResponseOfDelete(ACTION_MANAGEMENT_API_BASE_PATH + PRE_ISSUE_ACCESS_TOKEN_PATH +
"/" + TEST_ACTION_INVALID_ID)
.then()
.log().ifValidationFails()
.assertThat()
.statusCode(HttpStatus.SC_NO_CONTENT);
}

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

action = new ActionModel()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ public class ActionsTestBase extends RESTAPIServerTestBase {
protected static final String TEST_APIKEY_HEADER_AUTH_PROPERTY_VALUE = "key";
protected static final String TEST_APIKEY_VALUE_AUTH_PROPERTY = "value";
protected static final String TEST_APIKEY_VALUE_AUTH_PROPERTY_VALUE = "secret";
protected static final String TEST_USERNAME_INVALID_AUTH_PROPERTY = "invalidUsername";
protected static final String TEST_ACTION_INVALID_ID = "invalid_id";

protected static final Set<String> NOT_IMPLEMENTED_ACTION_TYPE_PATHS = new HashSet<>();

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2356,7 +2356,7 @@
<properties>

<!--Carbon Identity Framework Version-->
<carbon.identity.framework.version>7.7.30</carbon.identity.framework.version>
<carbon.identity.framework.version>7.7.33</carbon.identity.framework.version>
<carbon.identity.framework.version.range>[5.14.67, 8.0.0)</carbon.identity.framework.version.range>

<!--SAML Common Utils Version-->
Expand Down

0 comments on commit e48250f

Please sign in to comment.