Skip to content

Commit

Permalink
Update and enable TestInducement
Browse files Browse the repository at this point in the history
This test was originally contributed by Micheal, but then it somehow
slipped out of my attention and was not included as part of automated
test suite. This is fixed now.

This resolves MID-7617.
  • Loading branch information
mederly committed Mar 23, 2022
1 parent 99ea2bd commit 827a300
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,23 @@ public class TestInducement extends AbstractStoryTest {

public static final File TEST_DIR = new File(MidPointTestConstants.TEST_RESOURCES_DIR, "inducement");

public static final File ROLE_ROLE1_FILE = new File(TEST_DIR, "role-role1.xml");
public static final String ROLE_ROLE1_OID = "10000000-0000-0000-0000-100000000001";
private static final File ROLE_ROLE1_FILE = new File(TEST_DIR, "role-role1.xml");
private static final String ROLE_ROLE1_OID = "10000000-0000-0000-0000-100000000001";

public static final File ROLE_ROLE2_FILE = new File(TEST_DIR, "role-role2.xml");
public static final String ROLE_ROLE2_OID = "10000000-0000-0000-0000-100000000002";
private static final File ROLE_ROLE2_FILE = new File(TEST_DIR, "role-role2.xml");
private static final String ROLE_ROLE2_OID = "10000000-0000-0000-0000-100000000002";

public static final File ROLE_ROLE3_FILE = new File(TEST_DIR, "role-role3.xml");
public static final String ROLE_ROLE3_OID = "10000000-0000-0000-0000-100000000003";
private static final File ROLE_ROLE3_FILE = new File(TEST_DIR, "role-role3.xml");
private static final String ROLE_ROLE3_OID = "10000000-0000-0000-0000-100000000003";

public static final File ROLE_LOCK_FILE = new File(TEST_DIR, "role-lock.xml");
public static final String ROLE_LOCK_OID = "10000000-0000-0000-0000-10000000lock";
private static final File ROLE_LOCK_FILE = new File(TEST_DIR, "role-lock.xml");
private static final String ROLE_LOCK_OID = "277ea8e2-7530-4fd8-95f3-7e7ed842bf2c";

public static final File ROLE_PROCESSOR_FILE = new File(TEST_DIR, "role-processor.xml");
public static final String ROLE_PROCESSOR_OID = "10000000-0000-0000-0000-100processor";
private static final File ROLE_PROCESSOR_FILE = new File(TEST_DIR, "role-processor.xml");
private static final String ROLE_PROCESSOR_OID = "7ac43094-d012-4078-b9c3-2a319b8beb02";

public static final File USER_SIMPLE_FILE = new File(TEST_DIR, "user-simple.xml");
public static final String USER_SIMPLE_OID = "10000000-0000-0000-0001-100000simple";
private static final File USER_SIMPLE_FILE = new File(TEST_DIR, "user-simple.xml");
private static final String USER_SIMPLE_OID = "b2faca26-3a54-4668-ad15-0316857817e1";

@Override
public void initSystem(Task initTask, OperationResult initResult) throws Exception {
Expand Down
17 changes: 1 addition & 16 deletions testing/story/src/test/resources/inducement/role-lock.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,6 @@
-->
<role
xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:apti="http://midpoint.evolveum.com/xml/ns/public/common/api-types-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3"
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3"
xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
oid="10000000-0000-0000-0000-10000000lock"
version="1">
oid="277ea8e2-7530-4fd8-95f3-7e7ed842bf2c">
<name>Lock</name>
<activation>
<effectiveStatus>enabled</effectiveStatus>
<enableTimestamp>2019-05-23T13:31:24.828+02:00</enableTimestamp>
</activation>
<iteration>0</iteration>
<iterationToken />
</role>
13 changes: 2 additions & 11 deletions testing/story/src/test/resources/inducement/role-processor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,14 @@
-->
<role
xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:apti="http://midpoint.evolveum.com/xml/ns/public/common/api-types-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3"
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3"
xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
oid="10000000-0000-0000-0000-100processor"
version="1">
oid="7ac43094-d012-4078-b9c3-2a319b8beb02">
<name>INDUCEPROCESSOR</name>
<activation>
<effectiveStatus>enabled</effectiveStatus>
<enableTimestamp>2019-05-23T13:30:47.650+02:00</enableTimestamp>
</activation>
<iteration>0</iteration>
<iterationToken/>
<inducement>
<targetRef oid="10000000-0000-0000-0000-100000000001" relation="org:default" type="c:RoleType"/>
</inducement>
Expand All @@ -48,7 +39,7 @@
<expression>
<script>
<code>
!assignmentEvaluator.isMemberOf('10000000-0000-0000-0000-10000000lock')
!assignmentEvaluator.isMemberOf('277ea8e2-7530-4fd8-95f3-7e7ed842bf2c')
</code>
</script>
</expression>
Expand Down
17 changes: 1 addition & 16 deletions testing/story/src/test/resources/inducement/role-role1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,6 @@
-->
<role
xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:apti="http://midpoint.evolveum.com/xml/ns/public/common/api-types-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3"
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3"
xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
oid="10000000-0000-0000-0000-100000000001"
version="1">
oid="10000000-0000-0000-0000-100000000001">
<name>Role1</name>
<activation>
<effectiveStatus>enabled</effectiveStatus>
<enableTimestamp>2019-05-23T13:31:24.828+02:00</enableTimestamp>
</activation>
<iteration>0</iteration>
<iterationToken />
</role>
17 changes: 1 addition & 16 deletions testing/story/src/test/resources/inducement/role-role2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,6 @@
-->
<role
xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:apti="http://midpoint.evolveum.com/xml/ns/public/common/api-types-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3"
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3"
xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
oid="10000000-0000-0000-0000-100000000002"
version="1">
oid="10000000-0000-0000-0000-100000000002">
<name>Role2</name>
<activation>
<effectiveStatus>enabled</effectiveStatus>
<enableTimestamp>2019-05-23T13:31:24.828+02:00</enableTimestamp>
</activation>
<iteration>0</iteration>
<iterationToken />
</role>
17 changes: 1 addition & 16 deletions testing/story/src/test/resources/inducement/role-role3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,6 @@
-->
<role
xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:apti="http://midpoint.evolveum.com/xml/ns/public/common/api-types-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3"
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3"
xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
oid="10000000-0000-0000-0000-100000000003"
version="1">
oid="10000000-0000-0000-0000-100000000003">
<name>Role3</name>
<activation>
<effectiveStatus>enabled</effectiveStatus>
<enableTimestamp>2019-05-23T13:31:24.828+02:00</enableTimestamp>
</activation>
<iteration>0</iteration>
<iterationToken />
</role>
14 changes: 5 additions & 9 deletions testing/story/src/test/resources/inducement/user-simple.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,13 @@
~ This work is dual-licensed under the Apache License 2.0
~ and European Union Public License. See LICENSE file for details.
-->
<user oid="10000000-0000-0000-0001-100000simple"
xmlns='http://midpoint.evolveum.com/xml/ns/public/common/common-3'
xmlns:c='http://midpoint.evolveum.com/xml/ns/public/common/common-3'
xmlns:t='http://prism.evolveum.com/xml/ns/public/types-3'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
<user oid="b2faca26-3a54-4668-ad15-0316857817e1"
xmlns='http://midpoint.evolveum.com/xml/ns/public/common/common-3'>
<name>simple</name>
<fullName>Simple User</fullName>
<givenName>Simple</givenName>
<familyName>User</familyName>
<activation>
<administrativeStatus>enabled</administrativeStatus>
</activation>
<fullName>Simple User</fullName>
<givenName>Simple</givenName>
<familyName>User</familyName>
</user>
1 change: 1 addition & 0 deletions testing/story/testng-integration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
<class name="com.evolveum.midpoint.testing.story.correlation.TestInternalCorrelationMultiAccounts"/>
<class name="com.evolveum.midpoint.testing.story.correlation.TestInternalCorrelationMultiAccountsSimplified"/>
<class name="com.evolveum.midpoint.testing.story.TestVeryAuthoritativeSource"/>
<class name="com.evolveum.midpoint.testing.story.TestInducement"/>
</classes>
</test>
</suite>
Expand Down

0 comments on commit 827a300

Please sign in to comment.