Skip to content

Commit

Permalink
Add integration tests for pre issue access token password grant
Browse files Browse the repository at this point in the history
Add test cases

Improve formatting

Improve formatting

Clean the code

Restructre the architecture

Reformat the code

Revert unneccessary formatting

Add new application logic

Addressed the comments

Integrate mock service

Increase code readability

Reformat the code

Restructure the base architecture

Add new test case to testng file

Fix formatting issues

Update the implementation

Reset formatting

Fix formatting issues

Fix formatting issues

Remove data providers

Update snakeyaml dependency

Reformat code

Update the test atEnd method

Change the order of execution of atEnd method

Change the order of execution of atEnd method
  • Loading branch information
Shenali-SJ committed Aug 28, 2024
1 parent 8328d8e commit b6b9f89
Show file tree
Hide file tree
Showing 11 changed files with 1,216 additions and 1 deletion.
5 changes: 5 additions & 0 deletions modules/integration/tests-integration/tests-backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,11 @@
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
Expand Down
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);
}
}
Loading

0 comments on commit b6b9f89

Please sign in to comment.