@Test public void authenticatedUserIsAdminReturnsTrueWhenUserHasAdminRole() { given(retrieverMock.hasAdminRole()).willReturn(true); boolean actualIsAdmin = userAuthService.authenticatedUserIsAdmin(); assertThat(actualIsAdmin).isTrue(); }
@Override public boolean authenticatedUserIsAdmin() { return retriever.hasAdminRole(); }
DefaultUserAuthService implements UserAuthService { @Override public boolean authenticatedUserIsAdmin() { return retriever.hasAdminRole(); } }
DefaultUserAuthService implements UserAuthService { @Override public boolean authenticatedUserIsAdmin() { return retriever.hasAdminRole(); } DefaultUserAuthService(UserService userService, AuthenticationInfoRetriever retriever); }
DefaultUserAuthService implements UserAuthService { @Override public boolean authenticatedUserIsAdmin() { return retriever.hasAdminRole(); } DefaultUserAuthService(UserService userService, AuthenticationInfoRetriever retriever); @Override User getAuthenticatedUser(); @Override String getAuthenticatedUserId(); @Override boolean authenticatedUserIsAdmin(); @Override boolean userIsEffectivelyAManager(User user); }
DefaultUserAuthService implements UserAuthService { @Override public boolean authenticatedUserIsAdmin() { return retriever.hasAdminRole(); } DefaultUserAuthService(UserService userService, AuthenticationInfoRetriever retriever); @Override User getAuthenticatedUser(); @Override String getAuthenticatedUserId(); @Override boolean authenticatedUserIsAdmin(); @Override boolean userIsEffectivelyAManager(User user);  }