Search in sources :

Example 16 with Issue

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());
}
Also used : Issue(com.epam.ta.reportportal.ws.model.issue.Issue) FinishTestItemRQ(com.epam.ta.reportportal.ws.model.FinishTestItemRQ) BaseMvcTest(com.epam.ta.reportportal.ws.BaseMvcTest) Test(org.junit.jupiter.api.Test)

Example 17 with Issue

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());
}
Also used : Issue(com.epam.ta.reportportal.ws.model.issue.Issue) IssueDefinition(com.epam.ta.reportportal.ws.model.issue.IssueDefinition) DefineIssueRQ(com.epam.ta.reportportal.ws.model.issue.DefineIssueRQ) BaseMvcTest(com.epam.ta.reportportal.ws.BaseMvcTest) Test(org.junit.jupiter.api.Test)

Example 18 with Issue

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());
}
Also used : Issue(com.epam.ta.reportportal.ws.model.issue.Issue) FinishTestItemRQ(com.epam.ta.reportportal.ws.model.FinishTestItemRQ) BaseMvcTest(com.epam.ta.reportportal.ws.BaseMvcTest) Test(org.junit.jupiter.api.Test)

Example 19 with Issue

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());
}
Also used : Issue(com.epam.ta.reportportal.ws.model.issue.Issue) FinishTestItemRQ(com.epam.ta.reportportal.ws.model.FinishTestItemRQ) BaseMvcTest(com.epam.ta.reportportal.ws.BaseMvcTest) Test(org.junit.jupiter.api.Test)

Example 20 with Issue

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());
}
Also used : Issue(com.epam.ta.reportportal.ws.model.issue.Issue) FinishTestItemRQ(com.epam.ta.reportportal.ws.model.FinishTestItemRQ) BaseMvcTest(com.epam.ta.reportportal.ws.BaseMvcTest) Test(org.junit.jupiter.api.Test)

Aggregations

Issue (com.epam.ta.reportportal.ws.model.issue.Issue)23 Test (org.junit.jupiter.api.Test)19 BaseMvcTest (com.epam.ta.reportportal.ws.BaseMvcTest)15 FinishTestItemRQ (com.epam.ta.reportportal.ws.model.FinishTestItemRQ)10 IssueEntity (com.epam.ta.reportportal.entity.item.issue.IssueEntity)4 LinkExternalIssueRQ (com.epam.ta.reportportal.ws.model.item.LinkExternalIssueRQ)4 TestItem (com.epam.ta.reportportal.entity.item.TestItem)3 IssueDefinition (com.epam.ta.reportportal.ws.model.issue.IssueDefinition)3 IssueType (com.epam.ta.reportportal.entity.item.issue.IssueType)2 Launch (com.epam.ta.reportportal.entity.launch.Launch)2 ReportPortalException (com.epam.ta.reportportal.exception.ReportPortalException)2 ErrorRS (com.epam.ta.reportportal.ws.model.ErrorRS)2 DefineIssueRQ (com.epam.ta.reportportal.ws.model.issue.DefineIssueRQ)2 MvcResult (org.springframework.test.web.servlet.MvcResult)2 TO_LOCAL_DATE_TIME (com.epam.ta.reportportal.commons.EntityUtils.TO_LOCAL_DATE_TIME)1 Preconditions (com.epam.ta.reportportal.commons.Preconditions)1 Predicates.equalTo (com.epam.ta.reportportal.commons.Predicates.equalTo)1 ReportPortalUser (com.epam.ta.reportportal.commons.ReportPortalUser)1 BusinessRule.expect (com.epam.ta.reportportal.commons.validation.BusinessRule.expect)1 BusinessRuleViolationException (com.epam.ta.reportportal.commons.validation.BusinessRuleViolationException)1