Search in sources :

Example 1 with ActivityDetails

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

the class ActivityRepositoryTest method generateDetails.

private ActivityDetails generateDetails() {
    ActivityDetails details = new ActivityDetails();
    details.setObjectName("test");
    details.setHistory((Arrays.asList(HistoryField.of("test field", "old", "new"), HistoryField.of("test field 2", "old", "new"))));
    return details;
}
Also used : ActivityDetails(com.epam.ta.reportportal.entity.activity.ActivityDetails)

Example 2 with ActivityDetails

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

the class ActivityRepositoryTest method updateTest.

@SuppressWarnings("OptionalGetWithoutIsPresent")
@Test
void updateTest() {
    Activity activity = repository.findById(1L).get();
    final LocalDateTime now = LocalDateTime.now();
    final ActivityDetails details = generateDetails();
    final String action = "test";
    activity.setCreatedAt(now);
    activity.setAction(action);
    activity.setDetails(details);
    final Activity updated = repository.save(activity);
    assertEquals(now, updated.getCreatedAt());
    assertThat(updated.getDetails()).isEqualToIgnoringGivenFields(details, "mapper");
    assertEquals(action, updated.getAction());
}
Also used : LocalDateTime(java.time.LocalDateTime) ActivityDetails(com.epam.ta.reportportal.entity.activity.ActivityDetails) Activity(com.epam.ta.reportportal.entity.activity.Activity) BaseTest(com.epam.ta.reportportal.BaseTest) Test(org.junit.jupiter.api.Test)

Example 3 with ActivityDetails

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

the class ActivityRepositoryTest method generateActivity.

private Activity generateActivity() {
    Activity activity = new Activity();
    activity.setActivityEntityType(Activity.ActivityEntityType.DEFECT_TYPE.getValue());
    activity.setAction("create_defect");
    activity.setObjectId(11L);
    activity.setCreatedAt(LocalDateTime.now());
    activity.setProjectId(1L);
    activity.setUserId(1L);
    activity.setDetails(new ActivityDetails("test defect name"));
    return activity;
}
Also used : ActivityDetails(com.epam.ta.reportportal.entity.activity.ActivityDetails) Activity(com.epam.ta.reportportal.entity.activity.Activity)

Aggregations

ActivityDetails (com.epam.ta.reportportal.entity.activity.ActivityDetails)3 Activity (com.epam.ta.reportportal.entity.activity.Activity)2 BaseTest (com.epam.ta.reportportal.BaseTest)1 LocalDateTime (java.time.LocalDateTime)1 Test (org.junit.jupiter.api.Test)1