@Test public void shouldGetFulfillmentRolesForUser() throws Exception { List<FulfillmentRoleAssignment> fulfillmentRoleAssignments = asList(new FulfillmentRoleAssignment()); Long userId = 1L; Mockito.when(fulfillmentRoleAssignmentRepository.getFulfillmentRolesForUser(userId)).thenReturn(fulfillmentRoleAssignments); List<FulfillmentRoleAssignment> expectedFulfillmentRoleAssignments = fulfillmentRoleService.getRolesForUser(userId); verify(fulfillmentRoleAssignmentRepository).getFulfillmentRolesForUser(userId); assertThat(expectedFulfillmentRoleAssignments, is(fulfillmentRoleAssignments)); }
public List<FulfillmentRoleAssignment> getRolesForUser(Long userId) { return fulfillmentRoleAssignmentRepository.getFulfillmentRolesForUser(userId); }
FulfillmentRoleService { public List<FulfillmentRoleAssignment> getRolesForUser(Long userId) { return fulfillmentRoleAssignmentRepository.getFulfillmentRolesForUser(userId); } }
FulfillmentRoleService { public List<FulfillmentRoleAssignment> getRolesForUser(Long userId) { return fulfillmentRoleAssignmentRepository.getFulfillmentRolesForUser(userId); }  }
FulfillmentRoleService { public List<FulfillmentRoleAssignment> getRolesForUser(Long userId) { return fulfillmentRoleAssignmentRepository.getFulfillmentRolesForUser(userId); }  List<FulfillmentRoleAssignment> getRolesForUser(Long userId); void saveFulfillmentRoles(User user); List<FulfillmentRoleAssignment> getRolesWithRight(Long userId, String rightName); }
FulfillmentRoleService { public List<FulfillmentRoleAssignment> getRolesForUser(Long userId) { return fulfillmentRoleAssignmentRepository.getFulfillmentRolesForUser(userId); }  List<FulfillmentRoleAssignment> getRolesForUser(Long userId); void saveFulfillmentRoles(User user); List<FulfillmentRoleAssignment> getRolesWithRight(Long userId, String rightName);  }