use of com.seleniumtests.connectors.bugtracker.BugTracker in project seleniumRobot by bhecquet.
the class TestBugTracker method testUpdateIssue.
/**
* Update an existing issue as we fail on an other step
* @throws Exception
*/
@Test(groups = { "ut" })
public void testUpdateIssue() throws Exception {
FakeBugTracker fbt = spy(new FakeBugTracker());
PowerMockito.whenNew(FakeBugTracker.class).withAnyArguments().thenReturn(fbt);
when(fbt.issueAlreadyExists(any(IssueBean.class))).thenReturn(new IssueBean("ISSUE-1", "[Selenium][app][env][ng] test Test1 KO", "Test KO"));
BugTracker bugtracker = BugTracker.getInstance("fake", "http://foo/bar", "selenium", "user", "password", new HashMap<>());
bugtracker.createIssue("selenium", "DEV", "ngName", "testUpdateIssue", "some description", Arrays.asList(step1, step2, stepEnd), issueOptions);
// check that we check if the issue already exists
verify(fbt).issueAlreadyExists(any(IssueBean.class));
// check that issue is not created
verify(fbt, never()).createIssue(any(IssueBean.class));
verify(fbt).updateIssue(eq("ISSUE-1"), anyString(), anyList(), eq(step2));
}
use of com.seleniumtests.connectors.bugtracker.BugTracker in project seleniumRobot by bhecquet.
the class TestBugTracker method testOneInstanceIsCreatedForEachUrl.
@Test(groups = { "ut" })
public void testOneInstanceIsCreatedForEachUrl() throws Exception {
BugTracker bugtracker1 = BugTracker.getInstance("fake", "http://foo/bar2", "selenium", "user", "password", new HashMap<>());
BugTracker bugtracker2 = BugTracker.getInstance("fake", "http://foo/bar", "selenium", "user", "password", new HashMap<>());
Assert.assertNotEquals(bugtracker1, bugtracker2);
}
use of com.seleniumtests.connectors.bugtracker.BugTracker in project seleniumRobot by bhecquet.
the class TestBugTracker method testCreateIssueBeanNoStep.
/**
* If no steps are available, do not create IssueBean
* @throws Exception
*/
@Test(groups = { "ut" })
public void testCreateIssueBeanNoStep() throws Exception {
FakeBugTracker fbt = spy(new FakeBugTracker());
PowerMockito.whenNew(FakeBugTracker.class).withAnyArguments().thenReturn(fbt);
BugTracker bugtracker = BugTracker.getInstance("fake", "http://foo/bar", "selenium", "user", "password", new HashMap<>());
IssueBean issueBean = bugtracker.createIssueBean("[Selenium][selenium][DEV][ngName] test myTest KO", "myTest", "some description", new ArrayList<>(), issueOptions);
Assert.assertNull(issueBean);
}
use of com.seleniumtests.connectors.bugtracker.BugTracker in project seleniumRobot by bhecquet.
the class TestBugTracker method testDoNotCreateIssue.
/**
* Test issue is not created if no failed step is present during execution
* @throws Exception
*/
@Test(groups = { "ut" })
public void testDoNotCreateIssue() throws Exception {
FakeBugTracker fbt = spy(new FakeBugTracker());
PowerMockito.whenNew(FakeBugTracker.class).withAnyArguments().thenReturn(fbt);
BugTracker bugtracker = BugTracker.getInstance("fake", "http://foo/bar", "selenium", "user", "password", new HashMap<>());
bugtracker.createIssue("selenium", "DEV", "ngName", "testDoNotCreateIssue", "some description", Arrays.asList(step1, stepEnd), issueOptions);
// check that we check if the issue already exists
verify(fbt, never()).issueAlreadyExists(any(IssueBean.class));
// check that issue is created
verify(fbt, never()).createIssue(any(IssueBean.class));
}
use of com.seleniumtests.connectors.bugtracker.BugTracker in project seleniumRobot by bhecquet.
the class TestBugTracker method testDoNotUpdateIssue.
/**
* Do not update existing issue as we fail on the same step
* @throws Exception
*/
@Test(groups = { "ut" })
public void testDoNotUpdateIssue() throws Exception {
FakeBugTracker fbt = spy(new FakeBugTracker());
PowerMockito.whenNew(FakeBugTracker.class).withAnyArguments().thenReturn(fbt);
when(fbt.issueAlreadyExists(any(IssueBean.class))).thenReturn(new IssueBean("ISSUE-1", "[Selenium][app][env][ng] test Test1 KO", String.format(BugTracker.STEP_KO_PATTERN, 1)));
BugTracker bugtracker = BugTracker.getInstance("fake", "http://foo/bar", "selenium", "user", "password", new HashMap<>());
bugtracker.createIssue("selenium", "DEV", "ngName", "testDoNotUpdateIssue", "some description", Arrays.asList(step1, step2, stepEnd), issueOptions);
// check that we check if the issue already exists
verify(fbt).issueAlreadyExists(any(IssueBean.class));
// check that issue is not created
verify(fbt, never()).createIssue(any(IssueBean.class));
verify(fbt, never()).updateIssue(eq("ISSUE-1"), anyString(), anyList(), eq(step2));
}
Aggregations