use of com.evolveum.midpoint.model.api.correlator.CorrelationResult in project midpoint by Evolveum.
the class TestExpressionCorrelator method test110OwnerX.
/**
* The correlation code returns X.
*/
@Test
public void test110OwnerX() throws Exception {
given();
Task task = getTestTask();
OperationResult result = task.getResult();
String accountName = getTestNameShort();
DummyAccount account = DUMMY_RESOURCE_SOURCE.controller.addAccount(accountName);
account.addAttributeValue(ATTR_CORRELATION_CODE, ownersCode(USER_X));
when();
CorrelationResult correlationResult = correlateAccount(accountName, task, result);
then();
assertCorrelationResult(correlationResult, EXISTING_OWNER, USER_X.oid);
assertNoCorrelationCase(accountName, task, result);
}
use of com.evolveum.midpoint.model.api.correlator.CorrelationResult in project midpoint by Evolveum.
the class TestExpressionCorrelator method test140CustomPotentialMatches.
/**
* The correlation code returns empty list but a custom potential matches.
*/
@Test
public void test140CustomPotentialMatches() throws Exception {
given();
Task task = getTestTask();
OperationResult result = task.getResult();
String customCode = "import com.evolveum.midpoint.xml.ns._public.common.common_3.*\n\n" + "correlationContext.requestManualCorrelation([\n" + "\tnew BuiltInCorrelationPotentialMatchType()\n" + "\t\t.candidateOwnerRef('f2cb9158-3e3f-40c5-84da-7859c2da5535', UserType.COMPLEX_TYPE),\n" + "\tnew BuiltInCorrelationPotentialMatchType()\n" + "\t\t.candidateOwnerRef('712c127f-1320-4fa9-95fb-f833feac5f58', UserType.COMPLEX_TYPE)])\n" + "[]";
String accountName = getTestNameShort();
DummyAccount account = DUMMY_RESOURCE_SOURCE.controller.addAccount(accountName);
account.addAttributeValue(ATTR_CORRELATION_CODE, customCode);
when();
CorrelationResult correlationResult = correlateAccount(accountName, task, result);
then();
assertCorrelationResult(correlationResult, UNCERTAIN, null);
var aCase = assertCorrelationCase(accountName, task, result);
displayValue("case", prismContext.xmlSerializer().serialize(aCase.asPrismObject()));
}
use of com.evolveum.midpoint.model.api.correlator.CorrelationResult in project midpoint by Evolveum.
the class TestExpressionCorrelator method test130OwnersXYWithCase.
/**
* The correlation code returns X and Y. Correlation case is requested to be created.
*/
@Test
public void test130OwnersXYWithCase() throws Exception {
given();
Task task = getTestTask();
OperationResult result = task.getResult();
String accountName = getTestNameShort();
DummyAccount account = DUMMY_RESOURCE_SOURCE.controller.addAccount(accountName);
account.addAttributeValue(ATTR_CORRELATION_CODE, requestCaseCode() + ownersCode(USER_X, USER_Y));
when();
CorrelationResult correlationResult = correlateAccount(accountName, task, result);
then();
assertCorrelationResult(correlationResult, UNCERTAIN, null);
assertCorrelationCase(accountName, task, result);
}
use of com.evolveum.midpoint.model.api.correlator.CorrelationResult in project midpoint by Evolveum.
the class TestExpressionCorrelator method test120OwnersXY.
/**
* The correlation code returns X and Y. Because manual case is not created automatically, no case should be there.
*/
@Test
public void test120OwnersXY() throws Exception {
given();
Task task = getTestTask();
OperationResult result = task.getResult();
String accountName = getTestNameShort();
DummyAccount account = DUMMY_RESOURCE_SOURCE.controller.addAccount(accountName);
account.addAttributeValue(ATTR_CORRELATION_CODE, ownersCode(USER_X, USER_Y));
when();
CorrelationResult correlationResult = correlateAccount(accountName, task, result);
then();
assertCorrelationResult(correlationResult, UNCERTAIN, null);
assertNoCorrelationCase(accountName, task, result);
}
Aggregations