Skip to content

Commit

Permalink
Fix function library search by name
Browse files Browse the repository at this point in the history
The nameCopy property was not filled-in.

(cherry picked from commit ce30399)
  • Loading branch information
mederly committed Jul 31, 2018
1 parent 4551b09 commit d02b110
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Expand Up @@ -133,7 +133,7 @@ public void iterateSetWithPaging() throws Exception {
private void iterateGeneral(int offset, int size, int batch, final String... names) throws Exception {
OperationResult result = new OperationResult("search general");

final List<PrismObject> objects = new ArrayList<PrismObject>();
final List<PrismObject> objects = new ArrayList<>();

ResultHandler handler = new ResultHandler() {

Expand Down Expand Up @@ -911,4 +911,15 @@ public void testExtensionReferenceNonNull() throws SchemaException {
assertEquals("Should find 1 object", 1, cases.size());
}

@Test
public void testFunctionLibrary() throws SchemaException {
ObjectQuery query = QueryBuilder.queryFor(FunctionLibraryType.class, prismContext)
.item(ObjectType.F_NAME).eqPoly("fl1", "fl1").matchingOrig()
.build();
OperationResult result = new OperationResult("search");
List<PrismObject<FunctionLibraryType>> collections = repositoryService.searchObjects(FunctionLibraryType.class, query, null, result);
result.recomputeStatus();
assertTrue(result.isSuccess());
assertEquals("Should find 1 object", 1, collections.size());
}
}
4 changes: 4 additions & 0 deletions repo/repo-sql-impl-test/src/test/resources/basic/objects.xml
Expand Up @@ -1696,4 +1696,8 @@
</operationExecution>
</case>

<functionLibrary>
<name>fl1</name>
</functionLibrary>

</objects>
Expand Up @@ -79,5 +79,6 @@ public int hashCode() {
public static void copyFromJAXB(FunctionLibraryType jaxb, RFunctionLibrary repo, RepositoryContext repositoryContext,
IdGeneratorResult generatorResult) throws DtoTranslationException {
RObject.copyFromJAXB(jaxb, repo, repositoryContext, generatorResult);
repo.setNameCopy(RPolyString.copyFromJAXB(jaxb.getName()));
}
}

0 comments on commit d02b110

Please sign in to comment.