@Test public void shouldGetAdminRoles() throws Exception { RoleAssignment expected = new RoleAssignment(); when(mapper.getAdminRole(1L)).thenReturn(expected); RoleAssignment actual = repository.getAdminRole(1L); assertThat(actual, is(expected)); }
public RoleAssignment getAdminRole(Long userId) { return mapper.getAdminRole(userId); }
RoleAssignmentRepository { public RoleAssignment getAdminRole(Long userId) { return mapper.getAdminRole(userId); } }
RoleAssignmentRepository { public RoleAssignment getAdminRole(Long userId) { return mapper.getAdminRole(userId); } @Autowired  RoleAssignmentRepository(RoleAssignmentMapper roleAssignmentMapper); }
RoleAssignmentRepository { public RoleAssignment getAdminRole(Long userId) { return mapper.getAdminRole(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 RoleAssignment getAdminRole(Long userId) { return mapper.getAdminRole(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);  }