mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
[DS-3762] added an extra clause on the dc.title metadata field for the communities
This commit is contained in:

committed by
Tom Desair

parent
033a734fb5
commit
759d987332
@@ -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)
|
||||
);
|
||||
}
|
||||
|
@@ -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))
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user