Exemplo n.º 1
0
 @Test
 public void should_support_only_issues_with_issue_admin_permission() {
   when(userSessionMock.hasProjectPermission(UserRole.ISSUE_ADMIN, "foo:bar")).thenReturn(true);
   assertThat(action.supports(new DefaultIssue().setProjectKey("foo:bar").setResolution(null)))
       .isTrue();
   assertThat(action.supports(new DefaultIssue().setProjectKey("foo:bar2").setResolution(null)))
       .isFalse();
 }
Exemplo n.º 2
0
 @Test
 public void should_support_only_unresolved_issues() {
   when(userSessionMock.hasProjectPermission(UserRole.ISSUE_ADMIN, "foo:bar")).thenReturn(true);
   assertThat(action.supports(new DefaultIssue().setProjectKey("foo:bar").setResolution(null)))
       .isTrue();
   assertThat(
           action.supports(
               new DefaultIssue().setProjectKey("foo:bar").setResolution(Issue.RESOLUTION_FIXED)))
       .isFalse();
 }