Search in sources :

Example 11 with Activity

use of com.epam.ta.reportportal.entity.activity.Activity in project commons-dao by reportportal.

the class ActivityRepositoryTest method findByUserLogin.

@Test
void findByUserLogin() {
    final List<Activity> activities = repository.findByFilter(new Filter(Activity.class, Condition.EQUALS, false, "superadmin", CRITERIA_USER));
    assertNotNull(activities);
    assertTrue(!activities.isEmpty());
    activities.forEach(it -> assertEquals(1L, (long) it.getUserId()));
}
Also used : Filter(com.epam.ta.reportportal.commons.querygen.Filter) Activity(com.epam.ta.reportportal.entity.activity.Activity) BaseTest(com.epam.ta.reportportal.BaseTest) Test(org.junit.jupiter.api.Test)

Example 12 with Activity

use of com.epam.ta.reportportal.entity.activity.Activity in project commons-dao by reportportal.

the class ActivityRepositoryTest method findByObjectIdTest.

@Test
void findByObjectIdTest() {
    final List<Activity> activities = repository.findByFilter(new Filter(Activity.class, Condition.EQUALS, false, "4", CRITERIA_OBJECT_ID));
    assertNotNull(activities);
    assertTrue(!activities.isEmpty());
    activities.forEach(it -> assertEquals(4L, (long) it.getObjectId()));
}
Also used : Filter(com.epam.ta.reportportal.commons.querygen.Filter) Activity(com.epam.ta.reportportal.entity.activity.Activity) BaseTest(com.epam.ta.reportportal.BaseTest) Test(org.junit.jupiter.api.Test)

Aggregations

Activity (com.epam.ta.reportportal.entity.activity.Activity)12 BaseTest (com.epam.ta.reportportal.BaseTest)11 Test (org.junit.jupiter.api.Test)11 Filter (com.epam.ta.reportportal.commons.querygen.Filter)6 LocalDateTime (java.time.LocalDateTime)4 ActivityDetails (com.epam.ta.reportportal.entity.activity.ActivityDetails)3 PageRequest (org.springframework.data.domain.PageRequest)2 Condition (com.epam.ta.reportportal.commons.querygen.Condition)1 FilterCondition (com.epam.ta.reportportal.commons.querygen.FilterCondition)1 ActivityCriteriaConstant (com.epam.ta.reportportal.commons.querygen.constant.ActivityCriteriaConstant)1 CRITERIA_ID (com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_ID)1 CRITERIA_PROJECT_ID (com.epam.ta.reportportal.commons.querygen.constant.GeneralCriteriaConstant.CRITERIA_PROJECT_ID)1 CRITERIA_USER (com.epam.ta.reportportal.commons.querygen.constant.UserCriteriaConstant.CRITERIA_USER)1 HistoryField (com.epam.ta.reportportal.entity.activity.HistoryField)1 Comparators (com.google.common.collect.Comparators)1 Timestamp (java.sql.Timestamp)1 Duration (java.time.Duration)1 java.util (java.util)1 Lists (org.apache.commons.compress.utils.Lists)1 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)1