Skip to content

Commit

Permalink
Add changes to add and delete app
Browse files Browse the repository at this point in the history
  • Loading branch information
dewniMW committed Oct 31, 2023
1 parent 23b0d27 commit 5c5bb31
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public class OrganizationManagementSuccessTest extends OrganizationManagementBas
private String consumerKey;
private String consumerSecret;
private String orgSwitchedToken;
private String applicationId;
private static final String SYSTEM_SCOPE = "SYSTEM";

@Factory(dataProvider = "restAPIUserConfigProvider")
Expand All @@ -98,16 +99,22 @@ public OrganizationManagementSuccessTest(TestUserMode userMode, OrganizationLeve
}

@BeforeClass(alwaysRun = true)
private void testInit() {
private void testInit() throws Exception {

oAuth2RestClient = new OAuth2RestClient(serverURL, tenantInfo);
if (organizationLevel == OrganizationLevel.SUB_ORGANIZATION) {
applicationId = addApplication();
}
}

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

cleanUpOrganizations(createdOrgs);
if (organizationLevel == OrganizationLevel.SUB_ORGANIZATION) {
deleteApplication(applicationId);
}
oAuth2RestClient.closeHttpClient();
super.testFinish();
}
Expand All @@ -130,7 +137,6 @@ public void createOrganization() throws Exception {
} else {
org = "Level2Org";
parentId = subOrganizationId;
String applicationId = addApplication();
shareApplication(applicationId);

if (!isLegacyRuntimeEnabled) {
Expand All @@ -153,8 +159,6 @@ public void createOrganization() throws Exception {
.when()
.log().ifValidationFails()
.post(ORGANIZATION_MANAGEMENT_API_BASE_PATH);

deleteApp(applicationId);
}

responseOfPost.then()
Expand Down Expand Up @@ -337,7 +341,7 @@ private String getRoleV2ResourceId(String audienceType) throws Exception {
return null;
}

private void deleteApp(String applicationId) throws Exception {
private void deleteApplication(String applicationId) throws Exception {

oAuth2RestClient.deleteApplication(applicationId);
}
Expand Down

0 comments on commit 5c5bb31

Please sign in to comment.