adjust tests phase2 to support access_status filter

This commit is contained in:
Paulo Graça
2025-02-21 15:46:05 +00:00
parent cc972d55d9
commit 60f57327ef
3 changed files with 18 additions and 3 deletions

View File

@@ -1235,6 +1235,7 @@ public class DiscoveryRestControllerIT extends AbstractControllerIntegrationTest
SearchFilterMatcher.hasFileNameInOriginalBundleFilter(), SearchFilterMatcher.hasFileNameInOriginalBundleFilter(),
SearchFilterMatcher.hasFileDescriptionInOriginalBundleFilter(), SearchFilterMatcher.hasFileDescriptionInOriginalBundleFilter(),
SearchFilterMatcher.entityTypeFilter(), SearchFilterMatcher.entityTypeFilter(),
SearchFilterMatcher.accessStatusFilter(),
SearchFilterMatcher.isAuthorOfPublicationRelation(), SearchFilterMatcher.isAuthorOfPublicationRelation(),
SearchFilterMatcher.isProjectOfPublicationRelation(), SearchFilterMatcher.isProjectOfPublicationRelation(),
SearchFilterMatcher.isOrgUnitOfPublicationRelation(), SearchFilterMatcher.isOrgUnitOfPublicationRelation(),

View File

@@ -506,7 +506,8 @@ public class DiscoveryScopeBasedRestControllerIT extends AbstractControllerInteg
FacetEntryMatcher.subjectFacet(false), FacetEntryMatcher.subjectFacet(false),
FacetEntryMatcher.dateIssuedFacet(false), FacetEntryMatcher.dateIssuedFacet(false),
FacetEntryMatcher.hasContentInOriginalBundleFacet(false), FacetEntryMatcher.hasContentInOriginalBundleFacet(false),
FacetEntryMatcher.entityTypeFacet(false) FacetEntryMatcher.entityTypeFacet(false),
FacetEntryMatcher.accessStatusFacet(false)
)) ))
); );
} }
@@ -618,7 +619,8 @@ public class DiscoveryScopeBasedRestControllerIT extends AbstractControllerInteg
FacetEntryMatcher.subjectFacet(false), FacetEntryMatcher.subjectFacet(false),
FacetEntryMatcher.dateIssuedFacet(false), FacetEntryMatcher.dateIssuedFacet(false),
FacetEntryMatcher.hasContentInOriginalBundleFacet(false), FacetEntryMatcher.hasContentInOriginalBundleFacet(false),
FacetEntryMatcher.entityTypeFacet(false) FacetEntryMatcher.entityTypeFacet(false),
FacetEntryMatcher.accessStatusFacet(false)
)) ))
); );
} }
@@ -668,7 +670,8 @@ public class DiscoveryScopeBasedRestControllerIT extends AbstractControllerInteg
FacetEntryMatcher.subjectFacet(false), FacetEntryMatcher.subjectFacet(false),
FacetEntryMatcher.dateIssuedFacet(false), FacetEntryMatcher.dateIssuedFacet(false),
FacetEntryMatcher.hasContentInOriginalBundleFacet(false), FacetEntryMatcher.hasContentInOriginalBundleFacet(false),
FacetEntryMatcher.entityTypeFacet(false) FacetEntryMatcher.entityTypeFacet(false),
FacetEntryMatcher.accessStatusFacet(false)
)) ))
); );
} }

View File

@@ -111,6 +111,17 @@ public class SearchFilterMatcher {
checkOperators() checkOperators()
); );
} }
public static Matcher<? super Object> accessStatusFilter() {
return allOf(
hasJsonPath("$.filter", is("access-status")),
hasJsonPath("$.hasFacets", is(true)),
hasJsonPath("$.type", is("text")),
hasJsonPath("$.openByDefault", is(false)),
checkOperators()
);
}
public static Matcher<? super Object> isAuthorOfPublicationRelation() { public static Matcher<? super Object> isAuthorOfPublicationRelation() {
return allOf( return allOf(
hasJsonPath("$.filter", is("isAuthorOfPublication")), hasJsonPath("$.filter", is("isAuthorOfPublication")),