use of com.epam.ta.reportportal.commons.querygen.FilterCondition in project commons-dao by reportportal.
the class UserRepositoryTest method usersWithProjectSort.
@Test
void usersWithProjectSort() {
Filter filter = Filter.builder().withTarget(User.class).withCondition(new FilterCondition(Condition.CONTAINS, false, "chuba", CRITERIA_USER)).build();
PageRequest pageRequest = PageRequest.of(0, 5, Sort.Direction.ASC, CRITERIA_PROJECT);
Page<User> result = userRepository.findByFilter(filter, pageRequest);
assertEquals(2, result.getTotalElements());
}
use of com.epam.ta.reportportal.commons.querygen.FilterCondition in project commons-dao by reportportal.
the class LogRepositoryTest method getPageNumberTest.
@Test
void getPageNumberTest() {
Filter filter = Filter.builder().withTarget(Log.class).withCondition(new FilterCondition(Condition.EQUALS, false, "3", CRITERIA_TEST_ITEM_ID)).build();
Integer number = logRepository.getPageNumber(1L, filter, PageRequest.of(0, 10, Sort.by(Sort.Direction.ASC, CRITERIA_LOG_TIME)));
assertEquals(1L, (long) number, "Unexpected log page number");
}
use of com.epam.ta.reportportal.commons.querygen.FilterCondition in project commons-dao by reportportal.
the class LogRepositoryTest method findNestedItemsTest.
@Test
void findNestedItemsTest() {
Filter filter = Filter.builder().withTarget(Log.class).withCondition(new FilterCondition(Condition.EQUALS, false, "2", CRITERIA_TEST_ITEM_ID)).withCondition(new FilterCondition(Condition.IN, false, "FAILED, PASSED", CRITERIA_STATUS)).build();
logRepository.findNestedItems(2L, false, false, filter, PageRequest.of(2, 1));
}
Aggregations