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;
}
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());
}
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;
}
Aggregations