Skip to content

Commit

Permalink
schrodinger: m10 second test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Feb 9, 2021
1 parent 6a3ede2 commit 10d7ea5
Show file tree
Hide file tree
Showing 2 changed files with 254 additions and 6 deletions.
Expand Up @@ -36,8 +36,6 @@
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.List;

/**
* @author skublik
Expand All @@ -47,6 +45,7 @@ public class M10ObjectTemplate extends AbstractLabTest{

protected static final String LAB_OBJECTS_DIRECTORY = LAB_DIRECTORY + "M10/";
private static final File OBJECT_TEMPLATE_USER_FILE_10_3 = new File(LAB_OBJECTS_DIRECTORY + "objecttemplate/object-template-example-user-10-3.xml");
private static final File OBJECT_TEMPLATE_USER_FILE = new File(LAB_OBJECTS_DIRECTORY + "objecttemplate/object-template-example-user.xml");
private static final File LOOKUP_EMP_STATUS_FILE = new File(LAB_OBJECTS_DIRECTORY + "lookuptables/lookup-emp-status.xml");
private static final File CSV_3_RESOURCE_FILE_10_4 = new File(LAB_OBJECTS_DIRECTORY + "resources/localhost-csvfile-3-ldap-10-4.xml");
private static final File SYSTEM_CONFIGURATION_FILE_10 = new File(LAB_OBJECTS_DIRECTORY + "systemconfiguration/system-configuration-10.xml");
Expand All @@ -64,7 +63,7 @@ public class M10ObjectTemplate extends AbstractLabTest{
private static final File CSV_3_RESOURCE_FILE_10 = new File(LAB_OBJECTS_DIRECTORY + "resources/localhost-csvfile-3-ldap-10.xml");
private static final File HR_RESOURCE_FILE_10 = new File(LAB_OBJECTS_DIRECTORY + "resources/localhost-hr.xml");
private static final File HR_SYNCHRONIZATION_TASK_FILE = new File(LAB_OBJECTS_DIRECTORY + "tasks/task-opendj-livesync-full.xml");
private static final File OBJECT_TEMPLATE_USER_FILE = new File(LAB_OBJECTS_DIRECTORY + "objecttemplate/object-template-example-user-simple.xml");
private static final File OBJECT_TEMPLATE_USER_SIMPLE_FILE = new File(LAB_OBJECTS_DIRECTORY + "objecttemplate/object-template-example-user-simple.xml");
private static final File CSV_2_RESOURCE_FILE = new File(LAB_OBJECTS_DIRECTORY + "resources/localhost-csvfile-2-canteen-10.xml");

@BeforeClass(alwaysRun = true, dependsOnMethods = { "springTestContextBeforeTestClass" })
Expand Down Expand Up @@ -108,7 +107,7 @@ public void mod10test01SimpleObjectTemplate() throws IOException {
importObject(ARCHETYPE_ORG_COMPANY_FILE, true, true);
importObject(ARCHETYPE_ORG_GROUP_FILE, true, true);
importObject(ARCHETYPE_ORG_GROUP_LIST_FILE, true, true);
importObject(OBJECT_TEMPLATE_USER_FILE, true, true);
importObject(OBJECT_TEMPLATE_USER_SIMPLE_FILE, true, true);
importObject(KIRK_USER_TIBERIUS_FILE, true, true);
importObject(ORG_EXAMPLE_FILE, true, true);
importObject(ORG_SECRET_OPS_FILE, true, true);
Expand Down Expand Up @@ -214,8 +213,8 @@ public void mod10test01SimpleObjectTemplate() throws IOException {

@Test(dependsOnMethods = {"mod10test01SimpleObjectTemplate"})
public void mod10test02AutomaticAssignments() throws IOException {
importObject(ORG_EXAMPLE_FILE, true);
Selenide.sleep(MidPoint.TIMEOUT_DEFAULT_2_S);
importObject(OBJECT_TEMPLATE_USER_FILE, true);
Selenide.sleep(MidPoint.TIMEOUT_LONG_1_M);

ResourceAccountsTab<ViewResourcePage> accountTab = basicPage.listResources()
.table()
Expand Down
@@ -0,0 +1,249 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2010-2019 Evolveum and contributors
~
~ This work is dual-licensed under the Apache License 2.0
~ and European Union Public License. See LICENSE file for details.
-->
<objectTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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:q="http://prism.evolveum.com/xml/ns/public/query-3"
xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3"
oid="10000000-9999-9999-0000-a000fe000001">
<name>ExAmPLE User Template</name>
<mapping>
<name>ExAmPLE, Inc. User Template: Fullname</name>
<description>Generate fullname (enforcing, no weak mapping)</description>
<strength>strong</strength>
<source>
<path>givenName</path>
</source>
<source>
<path>familyName</path>
</source>
<expression>
<script>
<code>
basic.concatName(givenName, familyName)
</code>
</script>
</expression>
<target>
<path>fullName</path>
</target>
</mapping>
<mapping>
<name>ExAmPLE, Inc. User Template: Active org. assignment</name>
<strength>strong</strength>
<source>
<path>extension/empStatus</path>
</source>
<expression>
<assignmentTargetSearch>
<targetType>c:OrgType</targetType>
<filter>
<q:equal>
<q:path>c:name</q:path>
<q:value>ACTIVE</q:value>
</q:equal>
</filter>
</assignmentTargetSearch>
</expression>
<target>
<path>assignment</path>
</target>
<condition>
<script>
<code>empStatus == 'A'</code>
</script>
</condition>
</mapping>
<mapping>
<name>ExAmPLE, Inc. User Template: Inactive org. assignment</name>
<strength>strong</strength>
<source>
<path>extension/empStatus</path>
</source>
<expression>
<assignmentTargetSearch>
<targetType>c:OrgType</targetType>
<filter>
<q:equal>
<q:path>c:name</q:path>
<q:value>INACTIVE</q:value>
</q:equal>
</filter>
</assignmentTargetSearch>
</expression>
<target>
<path>assignment</path>
</target>
<condition>
<script>
<code>empStatus == 'I'</code>
</script>
</condition>
</mapping>
<mapping>
<name>ExAmPLE, Inc. User Template: Former employees org. assignment</name>
<strength>strong</strength>
<source>
<path>extension/empStatus</path>
</source>
<expression>
<assignmentTargetSearch>
<targetType>c:OrgType</targetType>
<filter>
<q:equal>
<q:path>c:name</q:path>
<q:value>FORMER</q:value>
</q:equal>
</filter>
</assignmentTargetSearch>
</expression>
<target>
<path>assignment</path>
</target>
<condition>
<script>
<code>empStatus == 'F'</code>
</script>
</condition>
</mapping>
<mapping>
<name>ExAmPLE, Inc. User Template: Department org. assignment</name>
<strength>strong</strength>
<source>
<path>extension/empStatus</path>
</source>
<source>
<!-- <path>organizationalUnit</path>-->
<path>costCenter</path>
</source>
<expression>
<assignmentTargetSearch>
<targetType>c:OrgType</targetType>
<filter>
<q:equal>
<!--<q:path>c:displayName</q:path>-->
<!-- name is "alphanumeric" identifier -->
<q:path>c:name</q:path>
<!-- "alphanumeric" identifier is in costCenter -->
<expression>
<script>
<!-- <code>return organizationalUnit</code>-->
<code>return costCenter</code>
</script>
</expression>
</q:equal>
</filter>
</assignmentTargetSearch>
</expression>
<target>
<path>assignment</path>
</target>
<condition>
<script>
<code>empStatus == 'A'</code>
</script>
</condition>
</mapping>
<mapping>
<name>ExAmPLE, Inc. User Template: Manager of Department org. assignment</name>
<strength>strong</strength>
<source>
<path>extension/isManager</path>
</source>
<source>
<path>extension/empStatus</path>
</source>
<source>
<path>costCenter</path>
<!-- <path>organizationalUnit</path>-->
</source>
<expression>
<assignmentTargetSearch>
<targetType>c:OrgType</targetType>
<filter>
<q:equal>
<!--<q:path>c:displayName</q:path>-->
<!-- name is "alphanumeric" identifier -->
<q:path>c:name</q:path>
<!-- identifier is "alphanumeric" identifier -->
<expression>
<script>
<code>return costCenter</code>
</script>
</expression>
</q:equal>
</filter>
<assignmentProperties>
<relation>org:manager</relation>
</assignmentProperties>
</assignmentTargetSearch>
</expression>
<target>
<path>assignment</path>
</target>
<condition>
<script>
<code>empStatus == 'A' &amp;&amp; isManager</code>
</script>
</condition>
</mapping>
<mapping>
<name>Internal Employee role assignment</name>
<description>Assign 'Internal Employee' role to active and inactive users.</description>
<strength>strong</strength>
<source>
<path>extension/empStatus</path>
</source>
<expression>
<assignmentTargetSearch>
<targetType>c:RoleType</targetType>
<filter>
<q:equal>
<q:path>c:name</q:path>
<q:value>Internal Employee</q:value>
</q:equal>
</filter>
</assignmentTargetSearch>
</expression>
<target>
<path>assignment</path>
</target>
<condition>
<script>
<code>(empStatus == 'A' || empStatus == 'I')</code>
</script>
</condition>
</mapping>
<!-- MID-101, LAB 10-3: Uncomment these lines to see lookup tables and attribute schema
override -->
<!--
<item>
<ref>extension/empStatus</ref>
<valueEnumerationRef oid="3db10c46-23b1-11e8-be0c-a31e9d8ba9d8" />
</item>
<item>
<ref>telephoneNumber</ref>
<help>Mobile Telephone Number</help>
</item>
<item>
<ref>honorificSuffix</ref>
<limitations>
<layer>presentation</layer>
<access>
<read>true</read>
<add>false</add>
<modify>false</modify>
</access>
</limitations>
</item>
-->
<!-- MID-101, LAB 10-3: End of comment -->
</objectTemplate>

0 comments on commit 10d7ea5

Please sign in to comment.