use of com.epam.ta.reportportal.ws.model.issue.Issue in project service-api by reportportal.
the class TestItemControllerTest method finishTestItemWithEmptyLinkedTickets.
@Test
void finishTestItemWithEmptyLinkedTickets() throws Exception {
FinishTestItemRQ rq = new FinishTestItemRQ();
rq.setLaunchUuid("334d153c-8f9c-4dff-8627-47dd003bee0f");
rq.setEndTime(Date.from(LocalDateTime.now().atZone(ZoneId.of("UTC")).toInstant()));
rq.setStatus("FAILED");
Issue issue = new Issue();
issue.setIssueType("pb001");
issue.setIgnoreAnalyzer(false);
issue.setExternalSystemIssues(Sets.newHashSet());
rq.setIssue(issue);
mockMvc.perform(put(SUPERADMIN_PROJECT_BASE_URL + "/item/3ab067e5-537b-45ff-9605-843ab695c96a").content(objectMapper.writeValueAsBytes(rq)).contentType(APPLICATION_JSON).with(token(oAuthHelper.getSuperadminToken()))).andExpect(status().isOk());
}
use of com.epam.ta.reportportal.ws.model.issue.Issue in project service-api by reportportal.
the class TestItemControllerTest method defineTestItemIssue.
@Test
void defineTestItemIssue() throws Exception {
DefineIssueRQ rq = new DefineIssueRQ();
IssueDefinition issueDefinition = new IssueDefinition();
issueDefinition.setId(3L);
Issue issue = new Issue();
issue.setIssueType("pb001");
issue.setIgnoreAnalyzer(false);
issueDefinition.setIssue(issue);
rq.setIssues(Collections.singletonList(issueDefinition));
mockMvc.perform(put(DEFAULT_PROJECT_BASE_URL + "/item").with(token(oAuthHelper.getDefaultToken())).contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(rq))).andExpect(status().isOk());
}
use of com.epam.ta.reportportal.ws.model.issue.Issue in project service-api by reportportal.
the class TestItemControllerTest method linkExternalIssues.
@Test
void linkExternalIssues() throws Exception {
LinkExternalIssueRQ rq = new LinkExternalIssueRQ();
rq.setTestItemIds(Collections.singletonList(3L));
Issue.ExternalSystemIssue issue = new Issue.ExternalSystemIssue();
issue.setBtsUrl("jira.com");
issue.setBtsProject("project");
issue.setTicketId("ticket1");
issue.setUrl("https://example.com/NEWTICKET1");
rq.setIssues(Collections.singletonList(issue));
mockMvc.perform(put(DEFAULT_PROJECT_BASE_URL + "/item/issue/link").with(token(oAuthHelper.getDefaultToken())).content(objectMapper.writeValueAsBytes(rq)).contentType(APPLICATION_JSON)).andExpect(status().isOk());
}
use of com.epam.ta.reportportal.ws.model.issue.Issue in project service-api by reportportal.
the class TestItemControllerTest method finishTestItemWithFailedStatus.
@Test
void finishTestItemWithFailedStatus() throws Exception {
FinishTestItemRQ rq = new FinishTestItemRQ();
rq.setLaunchUuid(UUID.randomUUID().toString());
rq.setEndTime(Date.from(LocalDateTime.now().atZone(ZoneId.of("UTC")).toInstant()));
rq.setStatus("FAILED");
Issue issue = new Issue();
issue.setIssueType("pb001");
rq.setIssue(issue);
mockMvc.perform(put(SUPERADMIN_PROJECT_BASE_URL + "/item/3ab067e5-537b-45ff-9605-843ab695c96a").content(objectMapper.writeValueAsBytes(rq)).contentType(APPLICATION_JSON).with(token(oAuthHelper.getSuperadminToken()))).andExpect(status().isOk());
}
use of com.epam.ta.reportportal.ws.model.issue.Issue in project service-api by reportportal.
the class TestItemControllerTest method finishTestItemWithFinishedParent.
@Sql("/db/test-item/item-change-status-from-passed.sql")
@Test
void finishTestItemWithFinishedParent() throws Exception {
FinishTestItemRQ rq = new FinishTestItemRQ();
rq.setLaunchUuid(UUID.randomUUID().toString());
rq.setEndTime(Date.from(LocalDateTime.now().atZone(ZoneId.of("UTC")).toInstant()));
rq.setStatus("FAILED");
Issue issue = new Issue();
issue.setIssueType("pb001");
rq.setIssue(issue);
Optional<TestItem> updatedItem = testItemRepository.findById(11L);
assertTrue(updatedItem.isPresent());
assertEquals(StatusEnum.IN_PROGRESS, updatedItem.get().getItemResults().getStatus());
mockMvc.perform(put(SUPERADMIN_PROJECT_BASE_URL + "/item/uuid_s_2_9").content(objectMapper.writeValueAsBytes(rq)).contentType(APPLICATION_JSON).with(token(oAuthHelper.getSuperadminToken()))).andExpect(status().isOk());
updatedItem = testItemRepository.findById(11L);
assertTrue(updatedItem.isPresent());
assertEquals(StatusEnum.FAILED, updatedItem.get().getItemResults().getStatus());
assertEquals(TestItemIssueGroup.PRODUCT_BUG, updatedItem.get().getItemResults().getIssue().getIssueType().getIssueGroup().getTestItemIssueGroup());
assertEquals(StatusEnum.FAILED, testItemRepository.findById(updatedItem.get().getParentId()).get().getItemResults().getStatus());
Launch launch = launchRepository.findById(updatedItem.get().getLaunchId()).get();
assertEquals(StatusEnum.FAILED, launch.getStatus());
}
Aggregations