@Test public void testGetRoles() { RoleResource role = mock(RoleResource.class); Set<RoleResource> expectedRoles = givenRoleManagerHasRoleWithRoles(mockWrappedRoleManager, role); Set<RoleResource> actualRoles = auditRoleManager.getRoles(role, true); verify(mockWrappedRoleManager).getRoles(eq(role), eq(true)); assertThat(actualRoles).containsExactlyInAnyOrderElementsOf(expectedRoles); }
@Override public Set<RoleResource> getRoles(RoleResource grantee, boolean includeInherited) throws RequestValidationException, RequestExecutionException { return wrappedRoleManager.getRoles(grantee, includeInherited); }
AuditRoleManager implements IRoleManager { @Override public Set<RoleResource> getRoles(RoleResource grantee, boolean includeInherited) throws RequestValidationException, RequestExecutionException { return wrappedRoleManager.getRoles(grantee, includeInherited); } }
AuditRoleManager implements IRoleManager { @Override public Set<RoleResource> getRoles(RoleResource grantee, boolean includeInherited) throws RequestValidationException, RequestExecutionException { return wrappedRoleManager.getRoles(grantee, includeInherited); } AuditRoleManager(); @VisibleForTesting  AuditRoleManager(IRoleManager wrappedRoleManager, AuditWhitelistManager whitelistManager, AuditAdapter auditAdapter, IAuthenticator authenticator); }
AuditRoleManager implements IRoleManager { @Override public Set<RoleResource> getRoles(RoleResource grantee, boolean includeInherited) throws RequestValidationException, RequestExecutionException { return wrappedRoleManager.getRoles(grantee, includeInherited); } AuditRoleManager(); @VisibleForTesting  AuditRoleManager(IRoleManager wrappedRoleManager, AuditWhitelistManager whitelistManager, AuditAdapter auditAdapter, IAuthenticator authenticator); @Override void validateConfiguration(); @Override void setup(); @Override Set<? extends IResource> protectedResources(); @Override Set<Option> supportedOptions(); @Override Set<Option> alterableOptions(); @Override void createRole(AuthenticatedUser performer, RoleResource role, RoleOptions options); @Override void alterRole(AuthenticatedUser performer, RoleResource role, RoleOptions options); @Override Map<String, String> getCustomOptions(RoleResource role); @Override void grantRole(AuthenticatedUser performer, RoleResource role, RoleResource grantee); @Override void revokeRole(AuthenticatedUser performer, RoleResource role, RoleResource revokee); @Override void dropRole(AuthenticatedUser performer, RoleResource role); @Override Set<RoleResource> getRoles(RoleResource grantee, boolean includeInherited); @Override Set<RoleResource> getAllRoles(); @Override boolean isSuper(RoleResource role); @Override boolean canLogin(RoleResource role); @Override boolean isExistingRole(RoleResource role); }
AuditRoleManager implements IRoleManager { @Override public Set<RoleResource> getRoles(RoleResource grantee, boolean includeInherited) throws RequestValidationException, RequestExecutionException { return wrappedRoleManager.getRoles(grantee, includeInherited); } AuditRoleManager(); @VisibleForTesting  AuditRoleManager(IRoleManager wrappedRoleManager, AuditWhitelistManager whitelistManager, AuditAdapter auditAdapter, IAuthenticator authenticator); @Override void validateConfiguration(); @Override void setup(); @Override Set<? extends IResource> protectedResources(); @Override Set<Option> supportedOptions(); @Override Set<Option> alterableOptions(); @Override void createRole(AuthenticatedUser performer, RoleResource role, RoleOptions options); @Override void alterRole(AuthenticatedUser performer, RoleResource role, RoleOptions options); @Override Map<String, String> getCustomOptions(RoleResource role); @Override void grantRole(AuthenticatedUser performer, RoleResource role, RoleResource grantee); @Override void revokeRole(AuthenticatedUser performer, RoleResource role, RoleResource revokee); @Override void dropRole(AuthenticatedUser performer, RoleResource role); @Override Set<RoleResource> getRoles(RoleResource grantee, boolean includeInherited); @Override Set<RoleResource> getAllRoles(); @Override boolean isSuper(RoleResource role); @Override boolean canLogin(RoleResource role); @Override boolean isExistingRole(RoleResource role);  }