Skip to content

Commit

Permalink
Merge pull request #17760 from ThaminduDilshan/thamindu-clientId
Browse files Browse the repository at this point in the history
Temporary disable tenant qualified disabled test cases
  • Loading branch information
ThaminduDilshan authored Nov 13, 2023
2 parents 3e61701 + 2d4458c commit 8221030
Showing 1 changed file with 30 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -397,36 +397,36 @@ public void testOAuthApplicationLoginIncorrectTenant() throws Exception {
Assert.fail("Expected exception not received.");
}

@Test(description = "Create an OAuth app in tenant 1 and try to login when tenant qualified urls are disabled.",
dependsOnMethods = "testOAuthApplicationLoginIncorrectTenant")
public void testOAuthApplicationLoginWhenTenantQualifiedUrlsDisabled() throws Exception {

// Disable tenant qualified urls/ tenanted sessions and restart the server.
changeISConfigurations();

// Create oauth app and add user.
ApplicationResponseModel tenant1App = createApplication(TENANT_1_DOMAIN);
Assert.assertNotNull(tenant1App, "OAuth app creation failed for tenant 1.");
tenant1UserId = createUser(TENANT_1_DOMAIN);

// Authenticate.
initiateAuthorizationRequest(false);
authenticateUser(false, TENANT_1_USER_USERNAME + "@" + TENANT_1_DOMAIN, TENANT_1_USER_PASSWORD,
TENANT_1_DOMAIN);
performConsentApproval(false, TENANT_1_DOMAIN);
generateAuthzCodeAccessToken(false, TENANT_1_DOMAIN);
introspectActiveAccessToken(TENANT_1_DOMAIN, TENANT_1_ADMIN_USERNAME, TENANT_1_ADMIN_PASSWORD);
}

private void changeISConfigurations() throws AutomationUtilException, IOException {

String carbonHome = Utils.getResidentCarbonHome();
File defaultTomlFile = getDeploymentTomlFile(carbonHome);
File modifiedConfigFile = new File(getISResourceLocation()
+ File.separator + "tenant.qualified" + File.separator
+ "tenant_qualified_url_tenanted_sessions_disabled.toml");
serverConfigurationManager.applyConfiguration(modifiedConfigFile, defaultTomlFile, true, true);
}
// @Test(description = "Create an OAuth app in tenant 1 and try to login when tenant qualified urls are disabled.",
// dependsOnMethods = "testOAuthApplicationLoginIncorrectTenant")
// public void testOAuthApplicationLoginWhenTenantQualifiedUrlsDisabled() throws Exception {
//
// // Disable tenant qualified urls/ tenanted sessions and restart the server.
// changeISConfigurations();
//
// // Create oauth app and add user.
// ApplicationResponseModel tenant1App = createApplication(TENANT_1_DOMAIN);
// Assert.assertNotNull(tenant1App, "OAuth app creation failed for tenant 1.");
// tenant1UserId = createUser(TENANT_1_DOMAIN);
//
// // Authenticate.
// initiateAuthorizationRequest(false);
// authenticateUser(false, TENANT_1_USER_USERNAME + "@" + TENANT_1_DOMAIN, TENANT_1_USER_PASSWORD,
// TENANT_1_DOMAIN);
// performConsentApproval(false, TENANT_1_DOMAIN);
// generateAuthzCodeAccessToken(false, TENANT_1_DOMAIN);
// introspectActiveAccessToken(TENANT_1_DOMAIN, TENANT_1_ADMIN_USERNAME, TENANT_1_ADMIN_PASSWORD);
// }
//
// private void changeISConfigurations() throws AutomationUtilException, IOException {
//
// String carbonHome = Utils.getResidentCarbonHome();
// File defaultTomlFile = getDeploymentTomlFile(carbonHome);
// File modifiedConfigFile = new File(getISResourceLocation()
// + File.separator + "tenant.qualified" + File.separator
// + "tenant_qualified_url_tenanted_sessions_disabled.toml");
// serverConfigurationManager.applyConfiguration(modifiedConfigFile, defaultTomlFile, true, true);
// }

private void addTenant(String tenantDomain, String adminUsername, String adminPassword,
String adminTenantAwareUsername) throws Exception {
Expand Down

0 comments on commit 8221030

Please sign in to comment.