Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed minor-formatting issues in integration test files #20096

Merged
merged 8 commits into from
Mar 28, 2024
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ public void testOIDCLogout() throws IOException {
}

private void createOIDCApplication() throws Exception {

ApplicationModel application = new ApplicationModel();

List<String> grantTypes = new ArrayList<>();
Expand Down Expand Up @@ -310,6 +311,7 @@ private List<NameValuePair> getOIDCInitiationRequestParams() {
}

private void addAdminUser() throws Exception {

UserObject userInfo = new UserObject();
userInfo.setUserName(USERNAME);
userInfo.setPassword(PASSWORD);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,10 @@ public HttpResponse sendGetRequest(HttpClient client, String locationURL) throws
}

/**
* Create Application with the given app configurations
* Create Application with the given app configurations.
*
* @return ApplicationResponseModel
* @throws Exception exception
* @return ApplicationResponseModel.
* @throws Exception exception.
*/
private ApplicationResponseModel createApp() throws Exception {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public void testInit() throws Exception {

@AfterClass(alwaysRun = true)
public void atEnd() throws Exception {

deleteApp(application.getId());

consumerKey = null;
Expand Down Expand Up @@ -437,7 +438,7 @@ private String getLocationHeaderValue(HttpResponse response) {
/**
* Initiate service provider keys required for the tests.
*
* @throws Exception error
* @throws Exception error.
*/
private void initServiceProviderKeys() throws Exception {

Expand All @@ -464,8 +465,8 @@ private void initServiceProviderKeys() throws Exception {
* @param client CloseableHttpClient object to send the login post.
* @param sessionDataKey String sessionDataKey obtained.
* @return Extracted sessionDataKeyConsent.
* @throws IOException Error
* @throws URISyntaxException Error
* @throws IOException Error.
* @throws URISyntaxException Error.
*/
private String getSessionDataKeyConsent(CloseableHttpClient client, String sessionDataKey)
throws IOException, URISyntaxException {
Expand Down Expand Up @@ -497,8 +498,8 @@ private String getSessionDataKeyConsent(CloseableHttpClient client, String sessi
* @param idToken Encrypted ID token to be decrypted and checked.
* @param audience Audience value that should be appeared in the token.
* @return Boolean True if audience matches, False otherwise.
* @throws ParseException Error
* @throws JOSEException Error
* @throws ParseException Error.
* @throws JOSEException Error.
*/
private boolean decryptAndCheckIDToken(String idToken, String audience) throws ParseException, JOSEException {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
import org.testng.annotations.Test;
import org.wso2.carbon.automation.engine.context.TestUserMode;
import org.wso2.carbon.automation.test.utils.common.TestConfigurationProvider;
import org.wso2.identity.integration.test.rest.api.server.application.management.v1.model.*;
import org.wso2.identity.integration.test.rest.api.server.application.management.v1.model.ApplicationResponseModel;
import org.wso2.identity.integration.test.rest.api.server.application.management.v1.model.OpenIDConnectConfiguration;
import org.wso2.identity.integration.test.utils.OAuth2Constant;

import java.io.File;
Expand All @@ -57,7 +58,7 @@
import java.util.UUID;

/**
Integration tests for Signed Request Object validation.
* Integration tests for Signed Request Object validation.
*/
public class OAuth2RequestObjectSignatureValidationTestCase extends OAuth2ServiceAbstractIntegrationTest {

Expand All @@ -76,6 +77,7 @@ public void testInit() throws Exception {

@AfterClass(alwaysRun = true)
public void atEnd() throws Exception {

deleteApp(application.getId());

consumerKey = null;
Expand Down Expand Up @@ -264,6 +266,7 @@ private JWTClaimsSet getJwtClaimsSet(String consumerKey) {
}

private String buildSignedJWT(String consumerKey, RSAPrivateKey privateKey) throws Exception {

// Create RSA-signer with the private key
JWSSigner rsaSigner = new RSASSASigner(privateKey);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public void testInit() throws Exception {

@AfterClass(alwaysRun = true)
public void atEnd() throws Exception {

deleteApp(applicationId);
scim2RestClient.deleteRole(roleId);
scim2RestClient.deleteUser(userId);
Expand Down Expand Up @@ -189,6 +190,7 @@ public void testSendAuthorizedPostAfterRoleUpdate() throws Exception {
}

private UserObject getUserCreationInfo() {

UserObject userInfo = new UserObject();

userInfo.setUserName(USER_USERNAME);
Expand Down Expand Up @@ -221,13 +223,15 @@ private UserObject getUserCreationInfo() {
}

private RoleRequestObject getRoleCreationInfo() {

RoleRequestObject roleInfo = new RoleRequestObject();
roleInfo.setDisplayName(OAUTH_ROLE);

return roleInfo;
}

private PatchOperationRequestObject getAddUserPatchRole(String userId) {

RoleItemAddGroupobj patchRoleItem = new RoleItemAddGroupobj();
patchRoleItem.setOp(RoleItemAddGroupobj.OpEnum.ADD);
patchRoleItem.setPath(USERS_PATH);
Expand Down
Loading