use of com.seleniumtests.connectors.bugtracker.jira.JiraBean in project seleniumRobot by bhecquet.
the class TestJiraConnector method testCreateIssueWrongPriority.
/**
* Test issue creation with wrong priority
* @throws URISyntaxException
*/
@Test(groups = { "ut" }, expectedExceptions = ConfigurationException.class)
public void testCreateIssueWrongPriority() {
JiraConnector jiraConnector = new JiraConnector("http://foo/bar", PROJECT_KEY, "user", "password", jiraOptions);
JiraBean jiraBean = new JiraBean(null, "issue 1", "issue 1 descr", "P10", "Bug", null, null, null, null, new ArrayList<>(), null, new HashMap<>(), new ArrayList<>());
jiraConnector.createIssue(jiraBean);
}
use of com.seleniumtests.connectors.bugtracker.jira.JiraBean in project seleniumRobot by bhecquet.
the class TestJiraBean method testBeanCreation.
@Test(groups = "ut")
public void testBeanCreation() {
Map<String, String> customFieldsValues = new HashMap<>();
new JiraBean("summary", "description", "P1", "Bug", "testName", null, "assignee", "reporter", new ArrayList<>(), new File(""), customFieldsValues, Arrays.asList("comp1", "comp2"));
}
use of com.seleniumtests.connectors.bugtracker.jira.JiraBean in project seleniumRobot by bhecquet.
the class TestJiraBean method testBeanCreationNoIssueType.
@Test(groups = "ut", expectedExceptions = ConfigurationException.class)
public void testBeanCreationNoIssueType() {
Map<String, String> customFieldsValues = new HashMap<>();
new JiraBean("summary", "description", "P1", null, "testName", null, "assignee", "reporter", new ArrayList<>(), new File(""), customFieldsValues, Arrays.asList("comp1", "comp2"));
}
use of com.seleniumtests.connectors.bugtracker.jira.JiraBean in project seleniumRobot by bhecquet.
the class TestJiraConnector method testCreateIssueWithMinimalFields.
/**
* Test issue creation without fields, components, screenshots, ...
* @throws URISyntaxException
*/
@Test(groups = { "ut" })
public void testCreateIssueWithMinimalFields() throws URISyntaxException {
ArgumentCaptor<IssueInput> issueArgument = ArgumentCaptor.forClass(IssueInput.class);
JiraConnector jiraConnector = new JiraConnector("http://foo/bar", PROJECT_KEY, "user", "password", jiraOptions);
JiraBean jiraBean = new JiraBean(null, "issue 1", "issue 1 descr", "P1", "Bug", null, null, null, null, new ArrayList<>(), null, new HashMap<>(), new ArrayList<>());
jiraConnector.createIssue(jiraBean);
verify(issueRestClient).createIssue(issueArgument.capture());
// check issue has only mandatory fields
IssueInput issueInput = ((IssueInput) issueArgument.getValue());
Assert.assertEquals(issueInput.getField("summary").getValue(), "issue 1");
Assert.assertEquals(issueInput.getField("description").getValue(), "issue 1 descr");
Assert.assertEquals(((ComplexIssueInputFieldValue) (issueInput.getField("issuetype").getValue())).getValuesMap().get("id"), "1");
Assert.assertEquals(ImmutableList.copyOf(((Iterable<ComplexIssueInputFieldValue>) (issueInput.getField("components").getValue()))).size(), 0);
Assert.assertEquals(((ComplexIssueInputFieldValue) (issueInput.getField("project").getValue())).getValuesMap().get("key"), PROJECT_KEY);
Assert.assertNull(issueInput.getField("reporter"));
Assert.assertNull(issueInput.getField("assignee"));
// check attachments have been added (screenshot + detailed results)
verify(issueRestClient, never()).addAttachments(eq(new URI("http://foo/bar/i/1/attachments")), any(File.class));
}
use of com.seleniumtests.connectors.bugtracker.jira.JiraBean in project seleniumRobot by bhecquet.
the class TestJiraConnector method testCreateIssueWithMinimalFieldsOtherEmpty.
/**
* Test issue creation without fields, components, screenshots, ...
* @throws URISyntaxException
*/
@Test(groups = { "ut" })
public void testCreateIssueWithMinimalFieldsOtherEmpty() throws URISyntaxException {
ArgumentCaptor<IssueInput> issueArgument = ArgumentCaptor.forClass(IssueInput.class);
JiraConnector jiraConnector = new JiraConnector("http://foo/bar", PROJECT_KEY, "user", "password", jiraOptions);
JiraBean jiraBean = new JiraBean(null, "issue 1", "issue 1 descr", "", "Bug", "", null, "", "", new ArrayList<>(), null, new HashMap<>(), new ArrayList<>());
jiraConnector.createIssue(jiraBean);
verify(issueRestClient).createIssue(issueArgument.capture());
// check issue has only mandatory fields
IssueInput issueInput = ((IssueInput) issueArgument.getValue());
Assert.assertEquals(issueInput.getField("summary").getValue(), "issue 1");
Assert.assertEquals(issueInput.getField("description").getValue(), "issue 1 descr");
Assert.assertEquals(((ComplexIssueInputFieldValue) (issueInput.getField("issuetype").getValue())).getValuesMap().get("id"), "1");
Assert.assertEquals(ImmutableList.copyOf(((Iterable<ComplexIssueInputFieldValue>) (issueInput.getField("components").getValue()))).size(), 0);
Assert.assertEquals(((ComplexIssueInputFieldValue) (issueInput.getField("project").getValue())).getValuesMap().get("key"), PROJECT_KEY);
Assert.assertNull(issueInput.getField("reporter"));
Assert.assertNull(issueInput.getField("assignee"));
Assert.assertNull(issueInput.getField("priority"));
// check attachments have been added (screenshot + detailed results)
verify(issueRestClient, never()).addAttachments(eq(new URI("http://foo/bar/i/1/attachments")), any(File.class));
}
Aggregations