use of org.broadinstitute.consent.http.models.PaginationResponse in project consent by DataBiosphere.
the class DarCollectionResourceTest method testQueryCollectionsByFiltersAndUserRoles.
@Test
public void testQueryCollectionsByFiltersAndUserRoles() {
PaginationResponse<DarCollection> paginationResponse = new PaginationResponse<>();
when(userService.findUserByEmail(anyString())).thenReturn(researcher);
when(darCollectionService.queryCollectionsByFiltersAndUserRoles(any(User.class), any(PaginationToken.class), anyString())).thenReturn(paginationResponse);
initResource();
Response response = resource.queryCollectionsByFiltersAndUserRoles(authUser, "researcher", "DESC", "filterTerm", "projectTitle", 10);
assertEquals(HttpStatusCodes.STATUS_CODE_OK, response.getStatus());
}
use of org.broadinstitute.consent.http.models.PaginationResponse in project consent by DataBiosphere.
the class DarCollectionResourceTest method testGetCollectionsByToken.
@Test
public void testGetCollectionsByToken() {
PaginationResponse<DarCollection> paginationResponse = new PaginationResponse<>();
when(userService.findUserByEmail(anyString())).thenReturn(researcher);
when(darCollectionService.queryCollectionsByFiltersAndUserRoles(any(User.class), any(PaginationToken.class), anyString())).thenReturn(paginationResponse);
initResource();
String token = "eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MSwic29ydEZpZWxkIjoiZGFyX2NvZGUiLCJzb3J0RGlyZWN0aW9uIjoiREVTQyIsImZpbHRlcmVkQ291bnQiOjQsImZpbHRlcmVkUGFnZUNvdW50Ijo0LCJ1bmZpbHRlcmVkQ291bnQiOjQsImFjY2VwdGFibGVTb3J0RmllbGRzIjp7InByb2plY3RUaXRsZSI6InByb2plY3RUaXRsZSIsInJlc2VhcmNoZXIiOiJyZXNlYXJjaGVyIiwiaW5zdGl0dXRpb24iOiJpbnN0aXR1dGlvbl9uYW1lIiwiZGFyQ29kZSI6ImRhcl9jb2RlIn19";
Response response = resource.getCollectionsByToken(authUser, token, "researcher");
assertEquals(HttpStatusCodes.STATUS_CODE_OK, response.getStatus());
}
Aggregations