Search in sources :

Example 1 with IdentityTenantUtil

use of org.wso2.carbon.identity.core.util.IdentityTenantUtil in project carbon-identity-framework by wso2.

the class ConfigurationManagerTest method mockIdentityTenantUtility.

private void mockIdentityTenantUtility() {
    mockStatic(IdentityTenantUtil.class);
    IdentityTenantUtil identityTenantUtil = mock(IdentityTenantUtil.class);
    when(identityTenantUtil.getTenantDomain(any(Integer.class))).thenReturn(SUPER_TENANT_DOMAIN_NAME);
}
Also used : IdentityTenantUtil(org.wso2.carbon.identity.core.util.IdentityTenantUtil)

Example 2 with IdentityTenantUtil

use of org.wso2.carbon.identity.core.util.IdentityTenantUtil in project carbon-identity-framework by wso2.

the class ConfigurationManagerTest method mockIdentityTenantUtilForTheTest.

private void mockIdentityTenantUtilForTheTest() {
    mockStatic(IdentityTenantUtil.class);
    IdentityTenantUtil identityTenantUtil = mock(IdentityTenantUtil.class);
    when(identityTenantUtil.getTenantId(SUPER_TENANT_DOMAIN_NAME)).thenReturn(SUPER_TENANT_ID);
    when(identityTenantUtil.getTenantId(SAMPLE_TENANT_DOMAIN_ABC)).thenReturn(SAMPLE_TENANT_ID_ABC);
    when(identityTenantUtil.getTenantDomain(SUPER_TENANT_ID)).thenReturn(SUPER_TENANT_DOMAIN_NAME);
    when(identityTenantUtil.getTenantDomain(SAMPLE_TENANT_ID_ABC)).thenReturn(SAMPLE_TENANT_DOMAIN_ABC);
}
Also used : IdentityTenantUtil(org.wso2.carbon.identity.core.util.IdentityTenantUtil)

Example 3 with IdentityTenantUtil

use of org.wso2.carbon.identity.core.util.IdentityTenantUtil in project identity-governance by wso2-extensions.

the class IdentityMgtEventListenerTest method testDoPostAuthenticate.

@Test(dataProvider = "postAuthenticateHandler")
public void testDoPostAuthenticate(String userName, boolean authenticated) throws Exception {
    IdentityTenantUtil identityTenantUtil = new IdentityTenantUtil();
    identityTenantUtil.setRealmService(realmService);
    when(realmService.getBootstrapRealmConfiguration()).thenReturn(realmConfiguration);
    assertTrue(identityMgtEventListener.doPostAuthenticate(userName, authenticated, userStoreManager), "Do post authenticate flow is failed.");
}
Also used : IdentityTenantUtil(org.wso2.carbon.identity.core.util.IdentityTenantUtil) Test(org.testng.annotations.Test) BeforeTest(org.testng.annotations.BeforeTest)

Example 4 with IdentityTenantUtil

use of org.wso2.carbon.identity.core.util.IdentityTenantUtil in project carbon-identity-framework by wso2.

the class CarbonUtils method mockIdentityTenantUtility.

public static void mockIdentityTenantUtility() {
    mockStatic(IdentityTenantUtil.class);
    IdentityTenantUtil identityTenantUtil = mock(IdentityTenantUtil.class);
    when(IdentityTenantUtil.getTenantDomain(SUPER_TENANT_ID)).thenReturn(SUPER_TENANT_DOMAIN_NAME);
    when(IdentityTenantUtil.getTenantDomain(SampleTenant.ID)).thenReturn(SampleTenant.DOMAIN_NAME);
    when(IdentityTenantUtil.getTenantId(SUPER_TENANT_DOMAIN_NAME)).thenReturn(SUPER_TENANT_ID);
    when(IdentityTenantUtil.getTenantId(SampleTenant.DOMAIN_NAME)).thenReturn(SampleTenant.ID);
}
Also used : IdentityTenantUtil(org.wso2.carbon.identity.core.util.IdentityTenantUtil)

Example 5 with IdentityTenantUtil

use of org.wso2.carbon.identity.core.util.IdentityTenantUtil in project carbon-identity-framework by wso2.

the class SecretManagerTest method mockIdentityTenantUtility.

private void mockIdentityTenantUtility() {
    mockStatic(IdentityTenantUtil.class);
    IdentityTenantUtil identityTenantUtil = mock(IdentityTenantUtil.class);
    when(identityTenantUtil.getTenantDomain(any(Integer.class))).thenReturn(SUPER_TENANT_DOMAIN_NAME);
}
Also used : IdentityTenantUtil(org.wso2.carbon.identity.core.util.IdentityTenantUtil)

Aggregations

IdentityTenantUtil (org.wso2.carbon.identity.core.util.IdentityTenantUtil)5 BeforeTest (org.testng.annotations.BeforeTest)1 Test (org.testng.annotations.Test)1