Skip to content

Commit

Permalink
Add objects for detection and clustering task tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tchrapovic committed Aug 29, 2023
1 parent e385bd1 commit b6a8ba9
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
*
* Besides that, checks the "affected objects" management when a task changes.
*/
@ContextConfiguration(locations = {"classpath:ctx-model-intest-test-main.xml"})
@ContextConfiguration(locations = { "classpath:ctx-model-intest-test-main.xml" })
@DirtiesContext(classMode = ClassMode.AFTER_CLASS)
public class TestMiscTasks extends AbstractInitializedModelIntegrationTest {

Expand Down Expand Up @@ -73,6 +73,10 @@ public class TestMiscTasks extends AbstractInitializedModelIntegrationTest {
private static final TestTask TASK_ROLE_ANALYSIS_PATTERN_DETECTION_BASIC =
new TestTask(TEST_DIR, "task-role-analysis-pattern-detection-basic.xml", "a3429097-52c4-4474-80b7-fc1667584831");

private static final TestObject<RoleType> SESSION_ROLE_BASED = TestObject.file(
TEST_DIR, "session-role-based.xml", "c0d74ad2-f92a-40f0-b661-3c0a6a5dc225");
private static final TestObject<RoleType> CLUSTER_ROLE_BASED = TestObject.file(
TEST_DIR, "cluster-role-based.xml", "16a8b95a-8a37-4f91-b835-bb77670c2899");
private static final TestObject<RoleType> ROLE_BUSINESS_1 = TestObject.file(
TEST_DIR, "role-business-1.xml", "b48628a2-a032-47c2-947d-adc51940e920");
private static final TestObject<RoleType> ROLE_APPLICATION_1 = TestObject.file(
Expand All @@ -89,7 +93,7 @@ public void initSystem(Task initTask, OperationResult initResult) throws Excepti
super.initSystem(initTask, initResult);
initTestObjects(initTask, initResult,
ROLE_APPLICATION_1, ROLE_APPLICATION_2, ROLE_BUSINESS_1,
USER_1, USER_2);
USER_1, USER_2, SESSION_ROLE_BASED, CLUSTER_ROLE_BASED);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<roleAnalysisCluster xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3"
oid="16a8b95a-8a37-4f91-b835-bb77670c2899">
<name>cluster_0</name>
<!--TODO members-->
<roleAnalysisSessionRef oid="c0d74ad2-f92a-40f0-b661-3c0a6a5dc225"
relation="org:default"
type="c:RoleAnalysisSessionType">
<!-- role_based_analysis_session -->
</roleAnalysisSessionRef>
<detectionOption>
<minRolesOccupancy>10</minRolesOccupancy>
<minUserOccupancy>10</minUserOccupancy>
<frequencyRange>
<min>30.0</min>
<max>100.0</max>
</frequencyRange>
</detectionOption>
</roleAnalysisCluster>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<roleAnalysisSession xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
oid="c0d74ad2-f92a-40f0-b661-3c0a6a5dc225">
<name>role_based_analysis_session</name>
<processMode>role</processMode>
<roleModeOptions>
<similarityThreshold>80.0</similarityThreshold>
<minMembersCount>10</minMembersCount>
<propertiesRange>
<min>10.0</min>
<max>100.0</max>
</propertiesRange>
<minPropertiesOverlap>10</minPropertiesOverlap>
</roleModeOptions>
<defaultDetectionOption>
<minRolesOccupancy>10</minRolesOccupancy>
<minUserOccupancy>10</minUserOccupancy>
<frequencyRange>
<min>30.0</min>
<max>100.0</max>
</frequencyRange>
</defaultDetectionOption>
</roleAnalysisSession>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<activity>
<work>
<roleAnalysisClustering>
<sessionRef oid="67e46b84-3742-43c0-a510-3a399181dddf"/> <!-- random OID for now -->
<sessionRef oid="c0d74ad2-f92a-40f0-b661-3c0a6a5dc225"/> <!-- random OID for now -->
</roleAnalysisClustering>
</work>
</activity>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<activity>
<work>
<roleAnalysisPatternDetection>
<clusterRef oid="0d15e7ca-62b7-445f-9a3c-a8ee0b282aee"/> <!-- random OID for now -->
<clusterRef oid="16a8b95a-8a37-4f91-b835-bb77670c2899"/> <!-- random OID for now -->
</roleAnalysisPatternDetection>
</work>
</activity>
Expand Down

0 comments on commit b6a8ba9

Please sign in to comment.