1. Sebastian Sdorra
  2. scm-manager

Commits

Sebastian Sdorra  committed 657f56c

fix missing user role in mocked admin subject

  • Participants
  • Parent commits dc46a00
  • Branches issue-384

Comments (0)

Files changed (1)

File scm-test/src/main/java/sonia/scm/util/MockUtil.java

View file
  • Ignore whitespace
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import sonia.scm.security.Role;
 
 /**
  *
     when(subject.isPermittedAll(anyCollectionOf(Permission.class))).thenReturn(
       Boolean.TRUE);
     when(subject.isPermittedAll()).thenReturn(Boolean.TRUE);
-    when(subject.hasRole("admin")).thenReturn(Boolean.TRUE);
+    when(subject.hasRole(Role.ADMIN)).thenReturn(Boolean.TRUE);
+    when(subject.hasRole(Role.USER)).thenReturn(Boolean.TRUE);
 
     PrincipalCollection collection = mock(PrincipalCollection.class);