Skip to content

Commit

Permalink
repo-sqale: fix in ExtensionUpdateContext for TestUserTemplate
Browse files Browse the repository at this point in the history
Previously it threw exception if there was nothing to do, but this seems
to be valid case, so the update context now just returns with no action.
  • Loading branch information
virgo47 committed Jul 30, 2021
1 parent 9758b33 commit 45af56b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010-2017 Evolveum and contributors
* Copyright (C) 2010-2021 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
Expand Down Expand Up @@ -70,8 +70,10 @@ public class TestUserTemplate extends AbstractInitializedModelIntegrationTest {
protected static final File USER_TEMPLATE_USELESS_FILE = new File(TEST_DIR, "user-template-useless.xml");
protected static final String USER_TEMPLATE_USELESS_OID = "29b2936a-d1f6-4942-8e44-9ba44fc27423";

protected static final TestResource USER_TEMPLATE_MID_5892 = new TestResource(TEST_DIR, "user-template-mid-5892.xml", "064993c0-34b4-4440-9331-e909fc923504");
private static final TestResource USER_TEMPLATE_MID_6045 = new TestResource(TEST_DIR, "user-template-mid-6045.xml", "f3dbd582-11dc-473f-8b51-a30be5cbd5ce");
protected static final TestResource<?> USER_TEMPLATE_MID_5892 = new TestResource<>(
TEST_DIR, "user-template-mid-5892.xml", "064993c0-34b4-4440-9331-e909fc923504");
private static final TestResource<?> USER_TEMPLATE_MID_6045 = new TestResource<>(
TEST_DIR, "user-template-mid-6045.xml", "f3dbd582-11dc-473f-8b51-a30be5cbd5ce");

private static final String ACCOUNT_STAN_USERNAME = "stan";
private static final String ACCOUNT_STAN_FULLNAME = "Stan the Salesman";
Expand Down Expand Up @@ -3587,11 +3589,11 @@ public void test990SpecialTimedMapping() throws Exception {
.givenName("jim")
.subtype(SUBTYPE_MID_6045)
.beginTrigger()
.timestamp(firstTriggerTime)
.handlerUri(RecomputeTriggerHandler.HANDLER_URI)
.timestamp(firstTriggerTime)
.handlerUri(RecomputeTriggerHandler.HANDLER_URI)
.<UserType>end()
.beginAssignment()
.targetRef(SystemObjectsType.ROLE_SUPERUSER.value(), RoleType.COMPLEX_TYPE)
.targetRef(SystemObjectsType.ROLE_SUPERUSER.value(), RoleType.COMPLEX_TYPE)
.end();
repositoryService.addObject(user.asPrismObject(), null, result);

Expand All @@ -3604,8 +3606,8 @@ public void test990SpecialTimedMapping() throws Exception {
assertUser(user.getOid(), "user after")
.display()
.triggers()
.assertTriggers(3) // for some reason two new triggers are created
.end()
.assertTriggers(3) // for some reason two new triggers are created
.end()
.assertAssignments(1);
}
}
2 changes: 1 addition & 1 deletion model/model-intest/testng-integration-sqale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
<class name="com.evolveum.midpoint.model.intest.multi.TestMultiResource"/>
<class name="com.evolveum.midpoint.model.intest.multi.TestMultiAccount"/>
<class name="com.evolveum.midpoint.model.intest.multi.TestMultiConnectorResources"/>
<!--
<class name="com.evolveum.midpoint.model.intest.TestUserTemplate"/>
<!--
<class name="com.evolveum.midpoint.model.intest.TestUserTemplateWithRanges"/>
<class name="com.evolveum.midpoint.model.intest.orgstruct.TestOrgStruct"/>
<class name="com.evolveum.midpoint.model.intest.orgstruct.TestOrgStructMeta"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ public void deleteItem(String extItemId) {
@Override
protected void finishExecutionOwn() throws SchemaException, RepositoryException {
if (deletedItems.isEmpty() && changedItems.isEmpty()) {
throw new IllegalStateException(
"Extension modification executed but no changes detected");
return; // we don't have to do anything in the DB
}

// We need to avoid NULL otherwise the operations lower return NULL too.
Expand Down

0 comments on commit 45af56b

Please sign in to comment.