use of com.epam.ta.reportportal.ws.model.issue.Issue in project service-api by reportportal.
the class TestItemControllerTest method finishTestItemWithLinkedTicketsBadUrl.
@Test
void finishTestItemWithLinkedTicketsBadUrl() 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.ExternalSystemIssue ticket = new Issue.ExternalSystemIssue();
ticket.setBtsUrl("jira.com");
ticket.setBtsProject("project");
ticket.setTicketId("ticket1");
Issue issue = new Issue();
issue.setIssueType("pb001");
issue.setIgnoreAnalyzer(false);
issue.setExternalSystemIssues(Sets.newHashSet(ticket));
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().isBadRequest());
}
use of com.epam.ta.reportportal.ws.model.issue.Issue in project service-api by reportportal.
the class TestItemControllerTest method defineTestItemIssueNegative.
@Test
void defineTestItemIssueNegative() throws Exception {
DefineIssueRQ rq = new DefineIssueRQ();
IssueDefinition issueDefinition = new IssueDefinition();
issueDefinition.setId(100L);
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().isBadRequest());
}
use of com.epam.ta.reportportal.ws.model.issue.Issue in project service-api by reportportal.
the class TestItemControllerTest method finishTestItemWithLinkedTickets.
@Test
void finishTestItemWithLinkedTickets() 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.ExternalSystemIssue ticket = new Issue.ExternalSystemIssue();
ticket.setBtsUrl("jira.com");
ticket.setBtsProject("project");
ticket.setTicketId("ticket1");
ticket.setUrl("https://example.com/NEWTICKET1");
Issue issue = new Issue();
issue.setIssueType("pb001");
issue.setIgnoreAnalyzer(false);
issue.setExternalSystemIssues(Sets.newHashSet(ticket));
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 finishTestItemWithLinkedTicketsBadBtsProject.
@Test
void finishTestItemWithLinkedTicketsBadBtsProject() 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.ExternalSystemIssue ticket = new Issue.ExternalSystemIssue();
ticket.setBtsUrl("jira.com");
ticket.setTicketId("ticket1");
ticket.setUrl("https://example.com/NEWTICKET1");
Issue issue = new Issue();
issue.setIssueType("pb001");
issue.setIgnoreAnalyzer(false);
issue.setExternalSystemIssues(Sets.newHashSet(ticket));
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().isBadRequest());
}
use of com.epam.ta.reportportal.ws.model.issue.Issue in project service-api by reportportal.
the class TestItemControllerTest method finishTestItemWithLinkedTicketsBadTicketId.
@Test
void finishTestItemWithLinkedTicketsBadTicketId() 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.ExternalSystemIssue ticket = new Issue.ExternalSystemIssue();
ticket.setBtsUrl("jira.com");
ticket.setBtsProject("project");
ticket.setUrl("https://example.com/NEWTICKET1");
Issue issue = new Issue();
issue.setIssueType("pb001");
issue.setIgnoreAnalyzer(false);
issue.setExternalSystemIssues(Sets.newHashSet(ticket));
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().isBadRequest());
}
Aggregations