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);
}
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);
}
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.");
}
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);
}
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);
}
Aggregations