Skip to content

Commit

Permalink
MID-8842 ninja - expectedTotal processor + test
Browse files Browse the repository at this point in the history
(cherry picked from commit 612c8f7)
  • Loading branch information
1azyman committed Sep 4, 2023
1 parent 5eb6fba commit f77e8d9
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Copyright (C) 2010-2023 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
*/

package com.evolveum.midpoint.schema.validator.processor;

import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.prism.path.ItemPath;
import com.evolveum.midpoint.schema.validator.UpgradeObjectProcessor;
import com.evolveum.midpoint.schema.validator.UpgradePhase;
import com.evolveum.midpoint.schema.validator.UpgradePriority;
import com.evolveum.midpoint.schema.validator.UpgradeType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType;

@SuppressWarnings("unused")
public class ExpectedTotalProcessor implements UpgradeObjectProcessor<TaskType> {

@Override
public UpgradePhase getPhase() {
return UpgradePhase.BEFORE;
}

@Override
public UpgradePriority getPriority() {
return UpgradePriority.OPTIONAL;
}

@Override
public UpgradeType getType() {
return UpgradeType.MANUAL;
}

@Override
public boolean isApplicable(PrismObject<?> object, ItemPath path) {
return matchParentTypeAndItemName(object, path, TaskType.class, TaskType.F_EXPECTED_TOTAL);
}

@Override
public String upgradeDescription(PrismObject<TaskType> object, ItemPath path) {
return "No action needed currently. It will not be removed for now, since not all tasks were migrated to activities yet.";
}

@Override
public boolean process(PrismObject<TaskType> object, ItemPath path) throws Exception {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public void test50SecurityPolicy() throws Exception {
public void test60TaskLivesync() throws Exception {
testUpgradeValidator("task-livesync.xml", result -> {
Assertions.assertThat(result.getItems())
.hasSize(3);
.hasSize(4);

Assertions.assertThat(result.hasChanges()).isTrue();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<extension>
<rext:reportDataParam oid="e7df0b0e-48f7-4c32-a4a5-c444a48d08f0"/>
</extension>
<expectedTotal>123</expectedTotal>
<activity>
<work>
<cleanup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
</entry>
</mext:liveSyncErrorHandlingStrategy>
</extension>
<expectedTotal>123</expectedTotal>
<activity>
<work>
<cleanup>
Expand Down

0 comments on commit f77e8d9

Please sign in to comment.