[DS-3762] added an extra clause on the dc.title metadata field for the communities

This commit is contained in:
Raf Ponsaerts
2017-12-01 15:42:14 +01:00
committed by Tom Desair
parent 033a734fb5
commit 759d987332
2 changed files with 20 additions and 0 deletions

View File

@@ -25,6 +25,9 @@ public class CommunityMatcher {
hasJsonPath("$.name", is(name)),
hasJsonPath("$.handle", is(handle)),
hasJsonPath("$.type", is("community")),
hasJsonPath("$.metadata", Matchers.contains(
CommunityMetadataMatcher.matchTitle(name)
)),
matchLinks(uuid)
);
}

View File

@@ -0,0 +1,17 @@
package org.dspace.app.rest.matcher;
import org.hamcrest.Matcher;
import static com.jayway.jsonpath.matchers.JsonPathMatchers.hasJsonPath;
import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.is;
public class CommunityMetadataMatcher {
public static Matcher<? super Object> matchTitle(String title){
return allOf(
hasJsonPath("$.key", is("dc.title")),
hasJsonPath("$.value", is(title))
);
}
}