Skip to content

Commit

Permalink
Fixing model-intest
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Apr 10, 2015
1 parent 5c1efa4 commit 8a11b92
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Expand Up @@ -260,7 +260,7 @@ public <IV extends PrismValue,ID extends ItemDefinition> Collection<PartiallyRes
if (changeType == ChangeType.ADD) {
PartiallyResolvedItem<IV,ID> partialValue = objectToAdd.findPartial(propertyPath);
if (partialValue == null || partialValue.getItem() == null) {
return null;
return new ArrayList<>(0);
}
Item<IV,ID> item = partialValue.getItem();
ItemDelta<IV,ID> itemDelta = item.createDelta();
Expand All @@ -283,7 +283,7 @@ public <IV extends PrismValue,ID extends ItemDefinition> Collection<PartiallyRes
}
return deltas;
} else {
return null;
return new ArrayList<>(0);
}
}

Expand Down
Expand Up @@ -276,6 +276,9 @@ private <F extends FocusType> void processFocusCredentialsCommon(LensContext<F>
}

private <F extends FocusType> boolean hasValueDelta(ObjectDelta<F> focusDelta, ItemPath credentialsPath) {
if (focusDelta == null) {
return false;
}
for (PartiallyResolvedDelta<PrismValue, ItemDefinition> partialDelta: focusDelta.findPartial(credentialsPath)) {
LOGGER.trace("Residual delta:\n{}", partialDelta.debugDump());
ItemPath residualPath = partialDelta.getResidualPath();
Expand Down
Expand Up @@ -1990,9 +1990,10 @@ protected <F extends FocusType> void assertSideEffectiveDeltasOnly(ObjectDelta<F
}
int expectedModifications = 0;
// There may be metadata modification, we tolerate that
Collection<? extends ItemDelta<?,?>> metadataDelta = focusDelta.findItemDeltasSubPath(new ItemPath(UserType.F_METADATA));
if (metadataDelta != null && !metadataDelta.isEmpty()) {
expectedModifications++;
for (ItemDelta<?,?> modification: focusDelta.getModifications()) {
if (modification.getPath().containsName(ObjectType.F_METADATA)) {
expectedModifications++;
}
}
if (focusDelta.findItemDelta(new ItemPath(FocusType.F_ACTIVATION, ActivationType.F_ENABLE_TIMESTAMP)) != null) {
expectedModifications++;
Expand Down

0 comments on commit 8a11b92

Please sign in to comment.