use of com.seleniumtests.connectors.bugtracker.jira.JiraConnector in project seleniumRobot by bhecquet.
the class TestJiraConnector method testCloseIssueInvalidTransitionInSecondPosition.
@Test(groups = { "ut" }, expectedExceptions = ConfigurationException.class, expectedExceptionsMessageRegExp = "'bugtracker.jira.closeTransition': value \\[closeQuickly\\] is invalid for this issue in its current state, allowed transitions are \\[reopen, close\\]")
public void testCloseIssueInvalidTransitionInSecondPosition() {
when(promiseTransitions.claim()).thenReturn(Arrays.asList(transition3)).thenReturn(Arrays.asList(transition1, transition2));
jiraOptions.put("jira.closeTransition", "review/closeQuickly");
ArgumentCaptor<TransitionInput> transitionArgument = ArgumentCaptor.forClass(TransitionInput.class);
JiraConnector jiraConnector = new JiraConnector("http://foo/bar", PROJECT_KEY, "user", "password", jiraOptions);
jiraConnector.closeIssue("ISSUE-1", "closed");
verify(issueRestClient).transition(eq(issue1), transitionArgument.capture());
Assert.assertEquals(transitionArgument.getValue().getId(), 1);
}
use of com.seleniumtests.connectors.bugtracker.jira.JiraConnector in project seleniumRobot by bhecquet.
the class TestJiraConnector method testCreateJiraBeanNoFailedSteps.
@Test(groups = { "ut" })
public void testCreateJiraBeanNoFailedSteps() throws Exception {
jiraOptions.put("priority", "P1");
jiraOptions.put("assignee", "me");
jiraOptions.put("reporter", "you");
jiraOptions.put("jira.issueType", "Bug");
jiraOptions.put("jira.components", "comp1,comp2");
jiraOptions.put("jira.field.foo", "bar");
JiraConnector jiraConnector = new JiraConnector("http://foo/bar", PROJECT_KEY, "user", "password", jiraOptions);
IssueBean issueBean = jiraConnector.createIssueBean("[Selenium][selenium][DEV][ngName] test myTest KO", "testCreateJiraBean", "some description", Arrays.asList(step1, stepEnd), jiraOptions);
// that when no failed step exist, (this should not happen), this is not a problem for connector
Assert.assertNull(issueBean);
}
use of com.seleniumtests.connectors.bugtracker.jira.JiraConnector in project seleniumRobot by bhecquet.
the class TestJiraConnector method testCreateIssueWrongUser.
/**
* Test issue creation with wrong user
* @throws URISyntaxException
*/
@Test(groups = { "ut" }, expectedExceptions = ConfigurationException.class)
public void testCreateIssueWrongUser() {
JiraConnector jiraConnector = new JiraConnector("http://foo/bar", PROJECT_KEY, "user", "password", jiraOptions);
JiraBean jiraBean = new JiraBean(null, "issue 1", "issue 1 descr", null, "Bug", null, null, "notme", null, new ArrayList<>(), null, new HashMap<>(), new ArrayList<>());
jiraConnector.createIssue(jiraBean);
}
use of com.seleniumtests.connectors.bugtracker.jira.JiraConnector in project seleniumRobot by bhecquet.
the class TestJiraConnector method testCloseIssueMultipleTransitions.
@Test(groups = { "ut" })
public void testCloseIssueMultipleTransitions() {
when(promiseTransitions.claim()).thenReturn(Arrays.asList(transition3)).thenReturn(Arrays.asList(transition1, transition2));
jiraOptions.put("jira.closeTransition", "review/close");
ArgumentCaptor<TransitionInput> transitionArgument = ArgumentCaptor.forClass(TransitionInput.class);
JiraConnector jiraConnector = new JiraConnector("http://foo/bar", PROJECT_KEY, "user", "password", jiraOptions);
jiraConnector.closeIssue("ISSUE-1", "closed");
verify(issueRestClient, times(2)).transition(eq(issue1), transitionArgument.capture());
// transition to review state
Assert.assertEquals(transitionArgument.getAllValues().get(0).getId(), 3);
// transition to closed state
Assert.assertEquals(transitionArgument.getAllValues().get(1).getId(), 1);
}
use of com.seleniumtests.connectors.bugtracker.jira.JiraConnector 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);
}
Aggregations