@Test public void shouldGetAllRolesInTheSystem() throws Exception { List<Role> roles = new ArrayList<>(); when(roleRightsMapper.getAllRoles()).thenReturn(roles); List<Role> allRoles = roleRightsRepository.getAllRoles(); assertThat(allRoles, is(roles)); verify(roleRightsMapper).getAllRoles(); }
public List<Role> getAllRoles() { return roleRightsMapper.getAllRoles(); }
RoleRightsRepository { public List<Role> getAllRoles() { return roleRightsMapper.getAllRoles(); } }
RoleRightsRepository { public List<Role> getAllRoles() { return roleRightsMapper.getAllRoles(); } @Autowired  RoleRightsRepository(RoleRightsMapper roleRightsMapper, CommaSeparator commaSeparator); }
RoleRightsRepository { public List<Role> getAllRoles() { return roleRightsMapper.getAllRoles(); } @Autowired  RoleRightsRepository(RoleRightsMapper roleRightsMapper, CommaSeparator commaSeparator); void createRole(Role role); void updateRole(Role role); List<Role> getAllRoles(); Role getRole(Long roleId); List<Right> getAllRightsForUser(Long userId); List<Right> getRightsForUserOnSupervisoryNodeAndProgram(Long userId, List<SupervisoryNode> supervisoryNodes, Program program); List<Right> getRightsForUserOnHomeFacilityAndProgram(Long userId, Program program); RightType getRightTypeForRoleId(Long roleId); List<Right> getRightsForUserAndWarehouse(Long userId, Long warehouseId); }
RoleRightsRepository { public List<Role> getAllRoles() { return roleRightsMapper.getAllRoles(); } @Autowired  RoleRightsRepository(RoleRightsMapper roleRightsMapper, CommaSeparator commaSeparator); void createRole(Role role); void updateRole(Role role); List<Role> getAllRoles(); Role getRole(Long roleId); List<Right> getAllRightsForUser(Long userId); List<Right> getRightsForUserOnSupervisoryNodeAndProgram(Long userId, List<SupervisoryNode> supervisoryNodes, Program program); List<Right> getRightsForUserOnHomeFacilityAndProgram(Long userId, Program program); RightType getRightTypeForRoleId(Long roleId); List<Right> getRightsForUserAndWarehouse(Long userId, Long warehouseId);  }