Skip to content

Commit

Permalink
Merge branch 'fix-codecov-coverage' of https://github.com/Osara-B/car…
Browse files Browse the repository at this point in the history
…bon-identity-framework into fix-codecov-coverage
  • Loading branch information
Osara-B committed Dec 19, 2024
2 parents 4c18a27 + 5849258 commit 6d89915
Show file tree
Hide file tree
Showing 352 changed files with 13,147 additions and 556 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>action-mgt</artifactId>
<version>7.7.28-SNAPSHOT</version>
<version>7.7.51-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>action-mgt</artifactId>
<version>7.7.28-SNAPSHOT</version>
<version>7.7.51-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -89,14 +89,14 @@
</Bundle-SymbolicName>
<Bundle-Name>${project.artifactId}</Bundle-Name>
<Private-Package>
org.wso2.carbon.identity.action.management.cache,
org.wso2.carbon.identity.action.management.constant,
org.wso2.carbon.identity.action.management.dao.*,
org.wso2.carbon.identity.action.management.internal,
org.wso2.carbon.identity.action.management.service.impl,
org.wso2.carbon.identity.action.management.util
</Private-Package>
<Export-Package>
org.wso2.carbon.identity.action.management.cache,
org.wso2.carbon.identity.action.management.constant.error,
org.wso2.carbon.identity.action.management.exception,
org.wso2.carbon.identity.action.management.model,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
*/
public class ActionCacheEntry extends CacheEntry {

private static final long serialVersionUID = 2789265346825849739L;
private List<Action> actionsOfActionType;

public ActionCacheEntry(List<Action> actionsOfActionType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/
public class ActionTypeCacheKey extends CacheKey {

private static final long serialVersionUID = 8132735629148475983L;
private final String actionType;

public ActionTypeCacheKey(String actionType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ private ActionMgtSQLConstants() {

}

public static final String IDN_ACTION_PROPERTIES_TABLE = "IDN_ACTION_PROPERTIES";
public static final String IDN_ACTION_ENDPOINT_TABLE = "IDN_ACTION_ENDPOINT";

/**
* Column Names.
*/
Expand Down Expand Up @@ -81,19 +78,6 @@ public static class Query {
"PROPERTY_VALUE = :PROPERTY_VALUE; WHERE ACTION_UUID = :ACTION_UUID; AND " +
"TENANT_ID = :TENANT_ID; AND PROPERTY_NAME = :PROPERTY_NAME;";

// TODO: Remove this temporary queries once the IDN_ACTION_PROPERTIES table is created.
public static final String ADD_ACTION_ENDPOINT = "INSERT INTO IDN_ACTION_ENDPOINT (ACTION_UUID, " +
"PROPERTY_NAME, PROPERTY_VALUE, TENANT_ID) VALUES (:ACTION_UUID;, :PROPERTY_NAME;, :PROPERTY_VALUE;, " +
":TENANT_ID;)";
public static final String GET_ACTION_ENDPOINT_INFO_BY_ID = "SELECT PROPERTY_NAME, PROPERTY_VALUE FROM " +
"IDN_ACTION_ENDPOINT WHERE ACTION_UUID = :ACTION_UUID; AND TENANT_ID = :TENANT_ID;";
public static final String DELETE_ACTION_ENDPOINT_PROPERTY = "DELETE FROM IDN_ACTION_ENDPOINT WHERE " +
"PROPERTY_NAME = :PROPERTY_NAME; AND ACTION_UUID = :ACTION_UUID; AND TENANT_ID = :TENANT_ID;";
public static final String UPDATE_ACTION_ENDPOINT_PROPERTY = "UPDATE IDN_ACTION_ENDPOINT SET " +
"PROPERTY_VALUE = :PROPERTY_VALUE; WHERE ACTION_UUID = :ACTION_UUID; AND " +
"TENANT_ID = :TENANT_ID; AND PROPERTY_NAME = :PROPERTY_NAME;";


private Query() {

}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,12 @@ public void deleteAction(String actionType, String actionId, String tenantDomain
if (LOG.isDebugEnabled()) {
LOG.debug(String.format("Deleting Action for Action Type: %s and Action ID: %s", actionType, actionId));
}
String resolvedActionType = getActionTypeFromPath(actionType);
ActionDTO existingActionDTO = checkIfActionExists(resolvedActionType, actionId, tenantDomain);
DAO_FACADE.deleteAction(existingActionDTO, IdentityTenantUtil.getTenantId(tenantDomain));
auditLogger.printAuditLog(ActionManagementAuditLogger.Operation.DELETE, actionType, actionId);
ActionDTO existingActionDTO = DAO_FACADE.getActionByActionId(getActionTypeFromPath(actionType), actionId,
IdentityTenantUtil.getTenantId(tenantDomain));
if (existingActionDTO != null) {
DAO_FACADE.deleteAction(existingActionDTO, IdentityTenantUtil.getTenantId(tenantDomain));
auditLogger.printAuditLog(ActionManagementAuditLogger.Operation.DELETE, actionType, actionId);
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,16 @@ public void testDeleteAction() throws ActionMgtException {
Assert.assertNull(actions.get(PRE_ISSUE_ACCESS_TOKEN_PATH));
}

@Test(priority = 14)
public void testDeleteNonExistingAction() {

try {
actionManagementService.deleteAction(PRE_ISSUE_ACCESS_TOKEN_PATH, "invalid_id", TENANT_DOMAIN);
} catch (Exception e) {
Assert.fail();
}
}

private Map<String, String> resolveAuthPropertiesMap(Authentication authentication, String actionId)
throws SecretManagementException {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CREATE TABLE IF NOT EXISTS IDN_ACTION (
PRIMARY KEY (UUID)
);

CREATE TABLE IF NOT EXISTS IDN_ACTION_ENDPOINT (
CREATE TABLE IF NOT EXISTS IDN_ACTION_PROPERTIES (
ACTION_UUID CHAR(36) NOT NULL,
PROPERTY_NAME VARCHAR(100) NOT NULL,
PROPERTY_VALUE VARCHAR(255) NOT NULL,
Expand Down
2 changes: 1 addition & 1 deletion components/action-mgt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>identity-framework</artifactId>
<version>7.7.28-SNAPSHOT</version>
<version>7.7.51-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>api-resource-mgt</artifactId>
<version>7.7.28-SNAPSHOT</version>
<version>7.7.51-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>api-resource-mgt</artifactId>
<version>7.7.28-SNAPSHOT</version>
<version>7.7.51-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>org.wso2.carbon.identity.api.resource.mgt</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion components/api-resource-mgt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>identity-framework</artifactId>
<version>7.7.28-SNAPSHOT</version>
<version>7.7.51-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>application-mgt</artifactId>
<version>7.7.28-SNAPSHOT</version>
<version>7.7.51-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -61,6 +61,21 @@
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.central.log.mgt</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.testutil</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.framework</groupId>
<artifactId>org.wso2.carbon.identity.action.management</artifactId>
Expand Down Expand Up @@ -90,7 +105,11 @@
org.apache.axiom.*; version="${axiom.osgi.version.range}",
org.apache.commons.logging; version="${import.package.version.commons.logging}",
org.apache.commons.lang; version="${commons-lang.wso2.osgi.version.range}",
org.osgi.framework; version="${osgi.framework.imp.pkg.version.range}",
org.osgi.service.component; version="${osgi.service.component.imp.pkg.version.range}",
org.apache.commons.collections; version="${commons-collections.wso2.osgi.version.range}",
org.wso2.carbon.database.utils.jdbc; version="${org.wso2.carbon.database.utils.version.range}",
org.wso2.carbon.database.utils.jdbc.exceptions; version="${org.wso2.carbon.database.utils.version.range}",

org.apache.axis2.*; version="${axis2.osgi.version.range}",

Expand Down
Loading

0 comments on commit 6d89915

Please sign in to comment.