use of com.epam.ta.reportportal.entity.item.issue.IssueEntity in project service-api by reportportal.
the class IssueConverterTest method toModel.
@Test
void toModel() {
final IssueEntity issueEntity = getIssueEntity();
final Issue resource = IssueConverter.TO_MODEL.apply(issueEntity);
assertEquals(resource.getAutoAnalyzed(), issueEntity.getAutoAnalyzed());
assertEquals(resource.getComment(), issueEntity.getIssueDescription());
assertEquals(resource.getIgnoreAnalyzer(), issueEntity.getIgnoreAnalyzer());
assertEquals(resource.getIssueType(), issueEntity.getIssueType().getLocator());
}
use of com.epam.ta.reportportal.entity.item.issue.IssueEntity in project commons-dao by reportportal.
the class TestItemRepositoryTest method assertIssueExistsAndTicketsEmpty.
private void assertIssueExistsAndTicketsEmpty(TestItem testItem, Long expectedId) {
assertEquals(expectedId, testItem.getItemId());
IssueEntity issue = testItem.getItemResults().getIssue();
assertNotEquals(null, issue);
assertEquals(0, issue.getTickets().size());
}
use of com.epam.ta.reportportal.entity.item.issue.IssueEntity in project service-api by reportportal.
the class FinishTestItemHandlerImpl method resolveIssue.
private Optional<IssueEntity> resolveIssue(ReportPortalUser user, StatusEnum status, TestItem testItem, @Nullable Issue issue, Long projectId) {
if (isIssueRequired(testItem, status)) {
return ofNullable(issue).map(is -> {
// in provided issue should be locator id or NOT_ISSUE value
String locator = is.getIssueType();
if (!NOT_ISSUE_FLAG.getValue().equalsIgnoreCase(locator)) {
IssueType issueType = issueTypeHandler.defineIssueType(projectId, locator);
IssueEntity issueEntity = IssueConverter.TO_ISSUE.apply(is);
issueEntity.setIssueType(issueType);
if (!CollectionUtils.isEmpty(issue.getExternalSystemIssues())) {
externalTicketHandler.linkExternalTickets(user.getUsername(), Lists.newArrayList(issueEntity), new ArrayList<>(issue.getExternalSystemIssues()));
}
return Optional.of(issueEntity);
}
return Optional.<IssueEntity>empty();
}).orElseGet(() -> {
IssueEntity issueEntity = new IssueEntity();
IssueType toInvestigate = issueTypeHandler.defineIssueType(projectId, TO_INVESTIGATE.getLocator());
issueEntity.setIssueType(toInvestigate);
return Optional.of(issueEntity);
});
}
return Optional.empty();
}
use of com.epam.ta.reportportal.entity.item.issue.IssueEntity in project service-api by reportportal.
the class AbstractStatusChangingStrategy method addToInvestigateIssue.
protected void addToInvestigateIssue(TestItem testItem, Long projectId) {
IssueEntity issueEntity = new IssueEntity();
IssueType toInvestigate = issueTypeHandler.defineIssueType(projectId, TO_INVESTIGATE.getLocator());
issueEntity.setIssueType(toInvestigate);
issueEntity.setTestItemResults(testItem.getItemResults());
issueEntityRepository.save(issueEntity);
testItem.getItemResults().setIssue(issueEntity);
}
use of com.epam.ta.reportportal.entity.item.issue.IssueEntity in project service-api by reportportal.
the class IssueConverterTest method getIssueEntity.
private static IssueEntity getIssueEntity() {
final IssueEntity issue = new IssueEntity();
issue.setIssueType(new IssueType(new IssueGroup(TestItemIssueGroup.PRODUCT_BUG), "locator", "long name", "SNA", "color"));
issue.setIgnoreAnalyzer(false);
issue.setAutoAnalyzed(false);
issue.setIssueDescription("issue description");
return issue;
}
Aggregations