Пример #1
0
  public void testShouldBuildJiraOkUsingElementAndFixVersionsWithMoreThanOneFixVersion() {
    Element e = createClassMock(Element.class);
    List<JiraVersion> fixVersions = createInterfaceMock(List.class);

    setupMockActualsForElement(e, "LLU-1", "Blah", "BlahStatus", "BlahResolution", "BlahType");
    EasyMock.expect(fixVersions.get(0)).andReturn(TestObjects.Version_10);
    EasyMock.expect(fixVersions.size()).andReturn(2);

    replay();

    JiraIssue jira = jiraBuilder.buildJira(e, fixVersions);

    verify();

    assertJiraDetails(
        jira,
        "LLU-1",
        "Blah",
        "BlahStatus",
        "BlahResolution",
        "BlahType",
        new JiraVersion[] {TestObjects.Version_10});
    assertEquals(1, jira.getFixVersions().size());
    assertEquals(TestObjects.Version_10, jira.getFixVersions().get(0));
    assertEquals(null, jira.getBuildNo());
  }
Пример #2
0
  public void testShouldBuildJiraOkUsingElement() {
    Element e = createClassMock(Element.class);
    setupMockActualsForElement(e, "LLU-1", "Blah", "BlahStatus", "BlahResolution", "BlahType");

    replay();

    JiraIssue jira = jiraBuilder.buildJira(e);

    verify();

    assertJiraDetails(
        jira, "LLU-1", "Blah", "BlahStatus", "BlahResolution", "BlahType", new JiraVersion[] {});
    assertEquals(0, jira.getFixVersions().size());
    assertEquals(null, jira.getBuildNo());
  }
Пример #3
0
  public void testShouldBuildJirasOkUsingListOfElementsWithBuildNo() {
    List<Element> mockList = createInterfaceMock(List.class);
    EasyMock.expect(mockList.iterator()).andReturn(new TestIterator(listWithBuildNo, 1));
    EasyMock.expect(mockList.size()).andReturn(1).anyTimes();

    replay();

    List<JiraIssue> jiras = jiraBuilder.buildJiras(mockList);

    verify();

    assertEquals(1, jiras.size());
    JiraIssue jiraIssue = jiras.get(0);
    assertJiraDetails(
        jiraIssue,
        "LLU-4052",
        "Change SuiteDispatcher Log from Error to Debug when no jobs are found",
        "Open",
        "Unresolved",
        "Technical Debt",
        new JiraVersion[] {TestObjects.Version_Backlog});
    assertEquals("testBuildNo", jiraIssue.getBuildNo());
  }
Пример #4
0
  public void testShouldBuildJirasOkUsingListOfElementsWithoutBuildNo() {
    List<Element> mockList = createInterfaceMock(List.class);
    EasyMock.expect(mockList.iterator()).andReturn(new TestIterator(listWithOutBuildNo, 1));
    EasyMock.expect(mockList.size()).andReturn(1).anyTimes();

    replay();

    List<JiraIssue> jiras = jiraBuilder.buildJiras(mockList);

    verify();

    assertEquals(1, jiras.size());
    JiraIssue jiraIssue = jiras.get(0);
    assertJiraDetails(
        jiraIssue,
        "LLU-4119",
        "&apos;Quality Gateway&apos; tests set up",
        "Open",
        "Unresolved",
        "Story",
        new JiraVersion[] {TestObjects.Version_Backlog});
    assertEquals(null, jiraIssue.getBuildNo());
  }