use of org.olat.repository.model.SearchAuthorRepositoryEntryViewParams.OrderBy in project openolat by klemens.
the class RepositoryEntryAuthorQueriesTest method searchViews_orderBy.
@Test
public void searchViews_orderBy() {
Identity id = JunitTestHelper.createAndPersistIdentityAsRndUser("view-");
dbInstance.commit();
Roles roles = securityManager.getRoles(id);
SearchAuthorRepositoryEntryViewParams params = new SearchAuthorRepositoryEntryViewParams(id, roles);
params.setMarked(Boolean.TRUE);
for (OrderBy orderBy : OrderBy.values()) {
params.setOrderBy(orderBy);
params.setOrderByAsc(true);
List<RepositoryEntryAuthorView> viewAsc = repositoryEntryAuthorViewQueries.searchViews(params, 0, 10);
Assert.assertNotNull(viewAsc);
params.setOrderByAsc(false);
List<RepositoryEntryAuthorView> viewDesc = repositoryEntryAuthorViewQueries.searchViews(params, 0, 10);
Assert.assertNotNull(viewDesc);
}
}
Aggregations