Skip to content

Commit

Permalink
sqale: Updated tests and impl to reflect changes in repository behavi…
Browse files Browse the repository at this point in the history
…ours

  - NOOP changes does not increment version
  - Initial version is 0 as in old repo
  -Wrong UUIDs in tests
  • Loading branch information
tonydamage committed Sep 27, 2021
1 parent 94cf273 commit 0f930c0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ public void test023ModifyRepoAndGetResource() throws Exception {

// Change something that's not that important
ProjectionPolicyType projectionPolicyType = new ProjectionPolicyType();
projectionPolicyType.setLegalize(true);
projectionPolicyType.setLegalize(false);

ObjectDelta<ResourceType> objectDelta = prismContext.deltaFactory().object()
.createModificationReplaceContainer(ResourceType.class, RESOURCE_DUMMY_OID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3">
<name>will</name>
<resourceRef oid="ef2bc95b-does-noot-exis-t999dddddddd" />
<resourceRef oid="ef2bc95b-d0e5-0001-beef-0999dddddddd" />
<objectClass>ri:AccountObjectClass</objectClass>
<kind>account</kind>
<attributes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ public Jsonb processExtensions(
for (Item<?, ?> item : prismContainerValue.getItems()) {
try {
Objects.requireNonNull(item, "Object for converting must not be null.");
ExtItemInfo extItemInfo = findExtensionItem(item.getDefinition(), holderType);
ItemDefinition extDef = item.getDefinition();
if (extDef == null) {
continue; // item does not have definition, skipping
}
ExtItemInfo extItemInfo = findExtensionItem(extDef, holderType);
if (extItemInfo == null) {
continue; // not-indexed, skipping this item
}
Expand All @@ -48,7 +52,7 @@ public Jsonb processExtensions(
} catch (RuntimeException e) {
// If anything happens (like NPE in Map.of) we want to capture the "bad" item.
throw new SystemException(
"Unexpected exception while processing extension item " + item, e);
"Exception when translating extension item " + item, e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public AddObjectContext(
public String execute()
throws SchemaException, ObjectAlreadyExistsException {
try (JdbcSession jdbcSession = repositoryContext.newJdbcSession().startTransaction()) {
object.setVersion("1"); // initial add always uses 1 as version number
object.setVersion("0"); // initial add always uses 1 as version number
initContexts();
if (object.getOid() == null) {
return addObjectWithoutOid(jdbcSession);
Expand Down

0 comments on commit 0f930c0

Please sign in to comment.