mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 23:45:44 +01:00
fix missing user role in mocked admin subject
This commit is contained in:
@@ -62,6 +62,7 @@ import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import sonia.scm.security.Role;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -116,7 +117,8 @@ public final class MockUtil
|
||||
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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user