Package com.atlassian.jira.rest.client.api.domain

Examples of com.atlassian.jira.rest.client.api.domain.Worklog


        "apache-tomcat-5.5.30.zip", "avatar1.png", "jira_logo.gif", "snipe.png", "transparent-png.png"));

    // worklogs
    final Iterable<Worklog> worklogs = issue.getWorklogs();
    assertEquals(5, Iterables.size(worklogs));
    final Worklog expectedWorklog1 = new Worklog(
        toUri("http://localhost:8090/jira/rest/api/2/issue/10010/worklog/10011"),
        toUri("http://localhost:8090/jira/rest/api/latest/issue/10010"), TestConstants.USER1_BASIC,
        TestConstants.USER1_BASIC, "another piece of work",
        toDateTime("2010-08-17T16:38:00.013+02:00"), toDateTime("2010-08-17T16:38:24.948+02:00"),
        toDateTime("2010-08-17T16:37:00.000+02:00"), 15, Visibility.role("Developers"));
    final Worklog worklog1 = Iterables.get(worklogs, 1);
    assertEquals(expectedWorklog1, worklog1);

    final Worklog worklog2 = Iterables.get(worklogs, 2);
    assertEquals(Visibility.group("jira-users"), worklog2.getVisibility());

    final Worklog worklog3 = Iterables.get(worklogs, 3);
    assertEquals(StringUtils.EMPTY, worklog3.getComment());

    // comments
    assertEquals(4, Iterables.size(issue.getComments()));
    final Comment comment = issue.getComments().iterator().next();
    assertEquals(Visibility.Type.ROLE, comment.getVisibility().getType());
View Full Code Here


  @Test
  public void testParseIssueJiraRepresentationJrjc49() throws JSONException {
    final Issue issue = parseIssue("/json/issue/jrjc49.json");
    final Iterable<Worklog> worklogs = issue.getWorklogs();
    assertEquals(1, Iterables.size(worklogs));
    final Worklog worklog = Iterables.get(worklogs, 0);
    assertEquals("Worklog comment should be returned as empty string, when JIRA doesn't include it in reply",
        StringUtils.EMPTY, worklog.getComment());
    assertEquals(180, worklog.getMinutesSpent());
    assertEquals("deleteduser", worklog.getAuthor().getName());
  }
View Full Code Here

        resolveURI("rest/api/2/issue/10010/worklog/10012"),
        resolveURI("rest/api/2/issue/10010/worklog/10020"),
        resolveURI("rest/api/2/issue/10010/worklog/10021")
    ));

    final Worklog actualWorklog = Iterables.getLast(worklogs);
    final Worklog expectedWorklog = new Worklog(resolveURI("rest/api/2/issue/10010/worklog/10021"),
        resolveURI("rest/api/latest/issue/10010"), IntegrationTestUtil.USER_ADMIN, IntegrationTestUtil.USER_ADMIN,
        "Another work for 7 min", toDateTime("2010-08-27T15:00:02.104"), toDateTime("2010-08-27T15:00:02.104"),
        toDateTime("2010-08-27T14:59:00.000"), 7, null);
    assertEquals(expectedWorklog, actualWorklog);
View Full Code Here

  }

  @Test
  public void testFetchingIssueWithWorklogWhenAuthorIsDeleted() {
    final Issue issue = client.getIssueClient().getIssue(ISSUE_KEY_WITH_REMOVED_USER_DATA).claim();
    final Worklog worklog = issue.getWorklogs().iterator().next();
    assertNotNull(worklog);
    final BasicUser author = worklog.getAuthor();
    assertNotNull(author);
    assertThat(author.getName(), equalTo(REMOVED_USER_NAME));
    assertTrue("expected incomplete self uri", author.isSelfUriIncomplete());
  }
View Full Code Here

        resolveURI("rest/api/2/issue/10010/worklog/10012"),
        resolveURI("rest/api/2/issue/10010/worklog/10020"),
        resolveURI("rest/api/2/issue/10010/worklog/10021")
    ));

    final Worklog actualWorklog = Iterables.getLast(worklogs);
    final Worklog expectedWorklog = new Worklog(resolveURI("rest/api/2/issue/10010/worklog/10021"),
        resolveURI("rest/api/latest/issue/10010"), IntegrationTestUtil.USER_ADMIN, IntegrationTestUtil.USER_ADMIN,
        "Another work for 7 min", toDateTime("2010-08-27T15:00:02.104"), toDateTime("2010-08-27T15:00:02.104"),
        toDateTime("2010-08-27T14:59:00.000"), 7, null);
    assertEquals(expectedWorklog, actualWorklog);
View Full Code Here

    final WorklogInput worklogInput = worklogInputBuilder.setIssueUri(issue.getSelf()).build();
    issueClient.addWorklog(issue.getWorklogUri(), worklogInput).claim();

    // check if added correctly
    final Issue issueWithWorklog = issueClient.getIssue(issueKey).claim();
    final Worklog addedWorklog = getAddedWorklog(initialWorklogs, issueWithWorklog);
    assertEquals(worklogInput.getStartDate(), addedWorklog.getStartDate());
    assertEquals(worklogInput.getMinutesSpent(), addedWorklog.getMinutesSpent());
    assertEquals(worklogInput.getIssueUri(), addedWorklog.getIssueUri());
    assertEquals(worklogInput.getComment(), addedWorklog.getComment());
    assertEquals(worklogInput.getVisibility(), worklogInput.getVisibility());
  }
View Full Code Here

        resolveURI("rest/api/2/issue/10010/worklog/10012"),
        resolveURI("rest/api/2/issue/10010/worklog/10020"),
        resolveURI("rest/api/2/issue/10010/worklog/10021")
    ));

    final Worklog actualWorklog = Iterables.getLast(worklogs);
    final Worklog expectedWorklog = new Worklog(resolveURI("rest/api/2/issue/10010/worklog/10021"),
        resolveURI("rest/api/latest/issue/10010"), IntegrationTestUtil.USER_ADMIN, IntegrationTestUtil.USER_ADMIN,
        "Another work for 7 min", toDateTime("2010-08-27T15:00:02.104"), toDateTime("2010-08-27T15:00:02.104"),
        toDateTime("2010-08-27T14:59:00.000"), 7, null);
    assertEquals(expectedWorklog, actualWorklog);
View Full Code Here

    final DateTime updateDate = JsonParseUtil.parseDateTime(json, "updated");
    final DateTime startDate = JsonParseUtil.parseDateTime(json, "started");
    // timeSpentSeconds is not required due to bug: JRADEV-8825 (fixed in 5.0, Iteration 14).
    final int secondsSpent = json.optInt("timeSpentSeconds", 0);
    final Visibility visibility = new VisibilityJsonParser().parseVisibility(json);
    return new Worklog(self, issue, author, updateAuthor, comment, creationDate, updateDate, startDate,
        secondsSpent / 60, visibility);
  }
View Full Code Here

    final DateTime creationDate = JsonParseUtil.parseDateTime(json, "created");
    final DateTime updateDate = JsonParseUtil.parseDateTime(json, "updated");
    final DateTime startDate = JsonParseUtil.parseDateTime(json, "started");
    final int minutesSpent = json.getInt("minutesSpent");
    final Visibility visibility = new VisibilityJsonParser().parseVisibility(json);
    return new Worklog(self, issueUri, author, updateAuthor, comment, creationDate, updateDate, startDate, minutesSpent, visibility);
  }
View Full Code Here

    final WorklogInput worklogInput = worklogInputBuilder.setIssueUri(issue.getSelf()).build();
    issueClient.addWorklog(issue.getWorklogUri(), worklogInput).claim();

    // check if added correctly
    final Issue issueWithWorklog = issueClient.getIssue(issueKey).claim();
    final Worklog addedWorklog = getAddedWorklog(initialWorklogs, issueWithWorklog);
    assertEquals(worklogInput.getStartDate(), addedWorklog.getStartDate());
    assertEquals(worklogInput.getMinutesSpent(), addedWorklog.getMinutesSpent());
    assertEquals(worklogInput.getIssueUri(), addedWorklog.getIssueUri());
    assertEquals(worklogInput.getComment(), addedWorklog.getComment());
    assertEquals(worklogInput.getVisibility(), worklogInput.getVisibility());
  }
View Full Code Here

TOP

Related Classes of com.atlassian.jira.rest.client.api.domain.Worklog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.