@Test public void shouldGetAllocationRoles() throws Exception { List<RoleAssignment> expected = new ArrayList<>(); when(mapper.getAllocationRoles(1L)).thenReturn(expected); List<RoleAssignment> allocationRoles = repository.getAllocationRoles(1L); assertThat(allocationRoles, is(expected)); verify(mapper).getAllocationRoles(1L); }
public List<RoleAssignment> getAllocationRoles(Long userId) { return mapper.getAllocationRoles(userId); }
RoleAssignmentRepository { public List<RoleAssignment> getAllocationRoles(Long userId) { return mapper.getAllocationRoles(userId); } }
RoleAssignmentRepository { public List<RoleAssignment> getAllocationRoles(Long userId) { return mapper.getAllocationRoles(userId); } @Autowired  RoleAssignmentRepository(RoleAssignmentMapper roleAssignmentMapper); }
RoleAssignmentRepository { public List<RoleAssignment> getAllocationRoles(Long userId) { return mapper.getAllocationRoles(userId); } @Autowired  RoleAssignmentRepository(RoleAssignmentMapper roleAssignmentMapper); List<RoleAssignment> getRoleAssignmentsForUserWithRight(String rightName, Long userId); void deleteAllRoleAssignmentsForUser(Long id); List<RoleAssignment> getSupervisorRoles(Long userId); List<RoleAssignment> getHomeFacilityRoles(Long userId); List<RoleAssignment> getHomeFacilityRolesForUserOnGivenProgramWithRights(Long userId, Long programId, String... rightNames); RoleAssignment getAdminRole(Long userId); RoleAssignment getReportRole(Long userId); void insert(List<RoleAssignment> roleAssignments, final Long userId); List<RoleAssignment> getAllocationRoles(Long userId); RoleAssignment getReportingRole(Long userId); }
RoleAssignmentRepository { public List<RoleAssignment> getAllocationRoles(Long userId) { return mapper.getAllocationRoles(userId); } @Autowired  RoleAssignmentRepository(RoleAssignmentMapper roleAssignmentMapper); List<RoleAssignment> getRoleAssignmentsForUserWithRight(String rightName, Long userId); void deleteAllRoleAssignmentsForUser(Long id); List<RoleAssignment> getSupervisorRoles(Long userId); List<RoleAssignment> getHomeFacilityRoles(Long userId); List<RoleAssignment> getHomeFacilityRolesForUserOnGivenProgramWithRights(Long userId, Long programId, String... rightNames); RoleAssignment getAdminRole(Long userId); RoleAssignment getReportRole(Long userId); void insert(List<RoleAssignment> roleAssignments, final Long userId); List<RoleAssignment> getAllocationRoles(Long userId); RoleAssignment getReportingRole(Long userId);  }