Skip to content

Commit

Permalink
Update kernel version
Browse files Browse the repository at this point in the history
  • Loading branch information
Thisara-Welmilla committed Jan 20, 2024
1 parent b25ded6 commit d8fa9e5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
import org.wso2.carbon.user.core.service.RealmService;
import org.wso2.carbon.user.core.tenant.TenantManager;
import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
import org.wso2.carbon.utils.security.KeystoreUtils;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -84,7 +85,8 @@
*/
@PrepareForTest({IdentityProviderManager.class, IdentityUtil.class, IdentityApplicationManagementUtil.class,
KeyStoreManager.class, IdentitySAMLSSOServiceComponentHolder.class, SSOServiceProviderConfigManager.class,
IdentityTenantUtil.class, ServiceURLBuilder.class, IdentityConstants.class, FrameworkServiceComponent.class})
IdentityTenantUtil.class, ServiceURLBuilder.class, IdentityConstants.class, FrameworkServiceComponent.class,
KeystoreUtils.class})
@PowerMockIgnore({"javax.xml.*", "org.xml.*", "org.w3c.dom.*", "org.apache.xerces.*"})
public class SAMLSSOUtilTest extends PowerMockTestCase {

Expand Down Expand Up @@ -135,6 +137,13 @@ public void setUp() throws Exception {
TestUtils.startTenantFlow(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME);
}

private void prepareForGetKeyStorePath() throws Exception {
mockStatic(KeystoreUtils.class);
when(KeystoreUtils.getKeyStoreFileLocation(TestConstants.WSO2_TENANT_DOMAIN)).thenReturn(TestConstants
.WSO2_TENANT_DOMAIN.replace(".", "-") + TestUtils.getFilePath(TestConstants.KEY_STORE_NAME));
}


private void prepareForGetIssuer() throws Exception {

mockStatic(IdentityTenantUtil.class);
Expand Down Expand Up @@ -412,6 +421,7 @@ public void testGetX509CredentialImplForSuperTenant() throws Exception {
public void testGetX509CredentialImplForTenant() throws Exception {

prepareForGetIssuer();
prepareForGetKeyStorePath();
mockStatic(FrameworkServiceComponent.class);
when(FrameworkServiceComponent.getRealmService()).thenReturn(realmService);
when(realmService.getTenantManager()).thenReturn(tenantManager);
Expand All @@ -430,6 +440,7 @@ public void testGetX509CredentialImplForTenant() throws Exception {
public void testGetX509CredentialImplException() throws Exception {

prepareForGetIssuer();
prepareForGetKeyStorePath();
when(tenantManager.getTenantId(anyString())).thenReturn(1);
mockStatic(KeyStoreManager.class);
when(KeyStoreManager.getInstance(eq(1))).thenReturn(keyStoreManager);
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@
</modules>

<properties>
<carbon.kernel.version>4.9.22-SNAPSHOT</carbon.kernel.version>
<carbon.kernel.version>4.9.23</carbon.kernel.version>
<carbon.kernel.feature.version>4.9.0</carbon.kernel.feature.version>
<carbon.identity.framework.version>5.25.507</carbon.identity.framework.version>
<carbon.identity.framework.imp.pkg.version.range>[5.25.260, 7.0.0)
Expand Down

0 comments on commit d8fa9e5

Please sign in to comment.