@Test public void shouldGetFulfilmentRolesForUserWithRight() throws Exception { List<FulfillmentRoleAssignment> expectedRoles = asList(new FulfillmentRoleAssignment(3l, 4l, asList(4l))); when(fulfillmentRoleService.getRolesWithRight(3l, MANAGE_POD)).thenReturn(expectedRoles); List<FulfillmentRoleAssignment> actualRoles = service.getFulfilmentRolesWithRight(3l, MANAGE_POD); assertThat(expectedRoles, is(actualRoles)); }
public List<FulfillmentRoleAssignment> getFulfilmentRolesWithRight(Long userId, String rightName) { return fulfillmentRoleService.getRolesWithRight(userId, rightName); }
RoleAssignmentService { public List<FulfillmentRoleAssignment> getFulfilmentRolesWithRight(Long userId, String rightName) { return fulfillmentRoleService.getRolesWithRight(userId, rightName); } }
RoleAssignmentService { public List<FulfillmentRoleAssignment> getFulfilmentRolesWithRight(Long userId, String rightName) { return fulfillmentRoleService.getRolesWithRight(userId, rightName); }  }
RoleAssignmentService { public List<FulfillmentRoleAssignment> getFulfilmentRolesWithRight(Long userId, String rightName) { return fulfillmentRoleService.getRolesWithRight(userId, rightName); }  List<RoleAssignment> getHomeFacilityRoles(Long userId); RoleAssignment getAdminRole(Long userId); RoleAssignment getReportRole(Long userId); List<RoleAssignment> getSupervisorRoles(Long userId); List<RoleAssignment> getAllocationRoles(Long userId); List<RoleAssignment> getHomeFacilityRolesForUserOnGivenProgramWithRights(Long userId, Long programId, String... rightNames); List<RoleAssignment> getRoleAssignments(String rightName, Long userId); void saveRolesForUser(User user); List<FulfillmentRoleAssignment> getFulfilmentRoles(Long userId); List<FulfillmentRoleAssignment> getFulfilmentRolesWithRight(Long userId, String rightName); RoleAssignment getReportingRole(Long userId); }
RoleAssignmentService { public List<FulfillmentRoleAssignment> getFulfilmentRolesWithRight(Long userId, String rightName) { return fulfillmentRoleService.getRolesWithRight(userId, rightName); }  List<RoleAssignment> getHomeFacilityRoles(Long userId); RoleAssignment getAdminRole(Long userId); RoleAssignment getReportRole(Long userId); List<RoleAssignment> getSupervisorRoles(Long userId); List<RoleAssignment> getAllocationRoles(Long userId); List<RoleAssignment> getHomeFacilityRolesForUserOnGivenProgramWithRights(Long userId, Long programId, String... rightNames); List<RoleAssignment> getRoleAssignments(String rightName, Long userId); void saveRolesForUser(User user); List<FulfillmentRoleAssignment> getFulfilmentRoles(Long userId); List<FulfillmentRoleAssignment> getFulfilmentRolesWithRight(Long userId, String rightName); RoleAssignment getReportingRole(Long userId);  }