Skip to content

Commit

Permalink
Add story test for correlation of multi-accounts
Browse files Browse the repository at this point in the history
This captures the situation when we have multiple systems (potentially
with multiple accounts per person), and we have to internally correlate
against all of these data.

It is possible to use filters, but the configuration is verbose
and awkward.
  • Loading branch information
mederly committed Feb 26, 2022
1 parent 8f41cfc commit 559be8d
Show file tree
Hide file tree
Showing 20 changed files with 1,662 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ public static List<PrismProperty<?>> getSingleValuedProperties(@NotNull ObjectTy
return properties;
}

@SuppressWarnings("unused") // Used from scripts
public static Set<String> getValuesForPath(ObjectType object, Object... pathComponents) {
return getValuesForPath(object.asPrismObject(), ItemPath.create(pathComponents));
}

public static Set<String> getValuesForPath(ObjectType object, ItemPath path) {
return getValuesForPath(object.asPrismObject(), path);
}

public static Set<String> getValuesForPath(PrismObject<?> object, ItemPath path) {
return object.getAllValues(path).stream()
.filter(Objects::nonNull)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2850,6 +2850,7 @@
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:long"/>
</xsd:complexType>
<xsd:element name="loggingOverride" type="tns:LoggingOverrideType" />

Expand Down Expand Up @@ -2880,6 +2881,7 @@
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:long"/>
</xsd:complexType>
<xsd:element name="classLoggerLevelOverride" type="tns:ClassLoggerLevelOverrideType" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,45 +7,39 @@

package com.evolveum.midpoint.testing.story.correlation;

import static com.evolveum.midpoint.xml.ns._public.common.common_3.SynchronizationSituationType.*;

import static org.assertj.core.api.Assertions.assertThat;

import static com.evolveum.midpoint.xml.ns._public.common.common_3.SynchronizationSituationType.*;

import java.io.File;
import java.io.IOException;
import javax.xml.namespace.QName;

import com.evolveum.midpoint.model.api.CaseService;
import com.evolveum.midpoint.model.impl.correlator.CorrelationCaseManager;
import org.jetbrains.annotations.NotNull;
import org.testng.annotations.Test;

import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.prism.PrismPropertyDefinition;
import com.evolveum.midpoint.prism.path.ItemName;
import com.evolveum.midpoint.prism.path.ItemPath;
import com.evolveum.midpoint.schema.constants.SchemaConstants;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.schema.util.ObjectTypeUtil;
import com.evolveum.midpoint.schema.util.WorkItemId;
import com.evolveum.midpoint.test.TestResource;
import com.evolveum.midpoint.util.DOMUtil;
import com.evolveum.midpoint.util.exception.SchemaException;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;

import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.annotations.Test;

import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.test.CsvResource;
import com.evolveum.midpoint.test.TestResource;
import com.evolveum.midpoint.test.TestTask;
import com.evolveum.midpoint.util.DOMUtil;
import com.evolveum.midpoint.util.exception.CommonException;

import javax.xml.namespace.QName;
import com.evolveum.midpoint.util.exception.SchemaException;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;

/**
* Here we test the correlation that uses an ID Match implementation (real or dummy one).
*
* There are two source systems: `SIS` (Student Information System) and `HR` (Human Resources).
* They provide accounts using import, live sync, and reconciliation activities.
* But only `SIS` is currently implemented here.
*/
public abstract class AbstractIdMatchTest extends AbstractCorrelationTest {

Expand Down

0 comments on commit 559be8d

Please sign in to comment.