-
Notifications
You must be signed in to change notification settings - Fork 720
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20903 from Shenali-SJ/actions-integration-tests
[integration tests] Pre issues access token action with password grant type
- Loading branch information
Showing
11 changed files
with
1,216 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
...backend/src/test/java/org/wso2/identity/integration/test/actions/ActionsBaseTestCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). | ||
* | ||
* WSO2 LLC. licenses this file to you under the Apache License, | ||
* Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.wso2.identity.integration.test.actions; | ||
|
||
import org.wso2.carbon.automation.engine.context.TestUserMode; | ||
import org.wso2.identity.integration.test.oauth2.OAuth2ServiceAbstractIntegrationTest; | ||
import org.wso2.identity.integration.test.rest.api.server.action.management.v1.model.ActionModel; | ||
import org.wso2.identity.integration.test.restclients.ActionsRestClient; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* Base test case for action-related tests. | ||
* This class extends {@link OAuth2ServiceAbstractIntegrationTest} and provides the necessary setup | ||
* and utility methods for testing actions via the {@link ActionsRestClient}. | ||
*/ | ||
public class ActionsBaseTestCase extends OAuth2ServiceAbstractIntegrationTest { | ||
|
||
protected ActionsRestClient restClient; | ||
|
||
/** | ||
* Initialize the test case. | ||
* | ||
* @param userMode User Mode | ||
* @throws Exception If an error occurred while initializing the clients. | ||
*/ | ||
protected void init(TestUserMode userMode) throws Exception { | ||
|
||
super.init(userMode); | ||
|
||
restClient = new ActionsRestClient(serverURL, tenantInfo); | ||
|
||
setSystemproperties(); | ||
} | ||
|
||
/** | ||
* Create action of different types. | ||
* | ||
* @param actionType Type of action | ||
* @param actionModel Request object to create the action | ||
* @return Status code of the action creation | ||
* @throws IOException If an error occurred while creating the action | ||
*/ | ||
public String createAction(String actionType, ActionModel actionModel) throws IOException { | ||
|
||
return restClient.createActionType(actionModel, actionType); | ||
} | ||
|
||
/** | ||
* Delete an action. | ||
* | ||
* @param actionType Type of action | ||
* @param actionId ID of the action | ||
* @return Status code of the action creation | ||
* @throws IOException If an error occurred while deleting the action | ||
*/ | ||
public int deleteAction(String actionType, String actionId) throws IOException { | ||
|
||
return restClient.deleteActionType(actionType, actionId); | ||
} | ||
} |
Oops, something went wrong.