@Test public void testGetWatchers() throws Exception { final Issue issue = client.getIssueClient().getIssue("TST-1").claim(); final Watchers watchers = client.getIssueClient().getWatchers(issue.getWatchers().getSelf()).claim(); assertEquals(1, watchers.getNumWatchers()); assertFalse(watchers.isWatching()); assertThat(watchers.getUsers(), containsInAnyOrder(USER1)); }
@Test public void testGetWatcherForAnonymouslyAccessibleIssue() { setAnonymousMode(); final Issue issue = client.getIssueClient().getIssue("ANNON-1").claim(); final Watchers watchers = client.getIssueClient().getWatchers(issue.getWatchers().getSelf()).claim(); assertEquals(1, watchers.getNumWatchers()); assertFalse(watchers.isWatching()); assertTrue("JRADEV-3594 bug!!!", Iterables.isEmpty(watchers.getUsers())); // to save time assertEquals(new TimeTracking(2700, 2400, null), issue.getTimeTracking()); }