use of com.epam.ta.reportportal.database.entity.item.issue.TestItemIssue in project commons-dao by reportportal.
the class TestItemRepositoryCustomImpl method updateItemsIssues.
@Override
public void updateItemsIssues(Map<String, TestItemIssue> forUpdate) {
Query query = query(where(ID).in(forUpdate.keySet()));
Update update = new Update();
mongoTemplate.stream(query, TestItem.class).forEachRemaining(dbo -> {
String currentId = dbo.getId();
TestItemIssue newValue = forUpdate.get(currentId);
update.set(ISSUE_TYPE, newValue.getIssueType());
update.set(ISSUE_DESCRIPTION, newValue.getIssueDescription());
update.set(ISSUE_TICKET, newValue.getExternalSystemIssues());
update.set(ISSUE_ANALYZED, newValue.isAutoAnalyzed());
mongoTemplate.updateFirst(Query.query(Criteria.where(ID).is(currentId)), update, mongoTemplate.getCollectionName(TestItem.class));
});
}
use of com.epam.ta.reportportal.database.entity.item.issue.TestItemIssue in project commons-dao by reportportal.
the class TestItemRepositoryTest method setUp.
@Before
public void setUp() {
String launch = "launch";
TestItem testItem = new TestItem();
testItem.setLaunchRef(launch);
testItem.setId(testItemId1);
testItem.setName("test");
testItem.setIssue(new TestItemIssue(TestItemIssueType.SYSTEM_ISSUE.getLocator(), null));
TestItem testItem1 = new TestItem();
testItem1.setId(testItemId2);
testItem1.setName("testName");
testItem1.setLaunchRef(launch);
testItem1.setType(TestItemType.SUITE);
testItem1.setIssue(new TestItemIssue(TestItemIssueType.NO_DEFECT.getLocator(), null));
TestItem testItem2 = new TestItem();
testItem2.setId(testItemId3);
testItem2.setName("test2");
testItem2.setIssue(new TestItemIssue("nd_custom", null));
testItem2.setType(TestItemType.SUITE);
testItem2.setLaunchRef(launch);
testItemRepository.save(testItem2);
testItemRepository.save(testItem1);
testItemRepository.save(testItem);
TestItem child = new TestItem();
child.setId(testItemId4);
child.setName("child");
child.setStatus(Status.FAILED);
child.setParent(testItem.getId());
testItemRepository.save(child);
}
Aggregations