@Test public void test_movement_service_repository_should_create_movement() { Movement movement1 = new Movement(); movement1.setId(1L); movement1.setEmployeeId(1L); movement1.setPositionAssigned(1L); movements = new ArrayList<>(); movements.add(movement1); final MovementRequest movementRequest = new MovementRequest(); movementRequest.setMovement(movements); movementRequest.setRequestInfo(requestInfo); when(movementRepository.saveMovement(Mockito.any(MovementRequest.class))).thenReturn(movementRequest); final MovementRequest result = movementService.create(movementRequest); assertEquals(result.getMovement().size(), movementRequest.getMovement().size()); }
public MovementRequest create(final MovementRequest movementRequest) { movementRequest.getMovement().get(0).setId(movementRepository.generateSequence()); return movementRepository.saveMovement(movementRequest); }
MovementService { public MovementRequest create(final MovementRequest movementRequest) { movementRequest.getMovement().get(0).setId(movementRepository.generateSequence()); return movementRepository.saveMovement(movementRequest); } }
MovementService { public MovementRequest create(final MovementRequest movementRequest) { movementRequest.getMovement().get(0).setId(movementRepository.generateSequence()); return movementRepository.saveMovement(movementRequest); }  }
MovementService { public MovementRequest create(final MovementRequest movementRequest) { movementRequest.getMovement().get(0).setId(movementRepository.generateSequence()); return movementRepository.saveMovement(movementRequest); }  List<Movement> getMovements(final MovementSearchRequest movementSearchRequest,
                                       final RequestInfo requestInfo); ResponseEntity<?> createMovements(final MovementRequest movementRequest, final String type); ResponseEntity<?> getSuccessResponseForCreate(final List<Movement> movementsList,
                                                         final RequestInfo requestInfo); MovementRequest create(final MovementRequest movementRequest); ResponseEntity<?> updateMovement(final MovementRequest movementRequest); Movement update(final MovementRequest movementRequest); Boolean checkEmployeeExists(final MovementRequest movementRequest); }
MovementService { public MovementRequest create(final MovementRequest movementRequest) { movementRequest.getMovement().get(0).setId(movementRepository.generateSequence()); return movementRepository.saveMovement(movementRequest); }  List<Movement> getMovements(final MovementSearchRequest movementSearchRequest,
                                       final RequestInfo requestInfo); ResponseEntity<?> createMovements(final MovementRequest movementRequest, final String type); ResponseEntity<?> getSuccessResponseForCreate(final List<Movement> movementsList,
                                                         final RequestInfo requestInfo); MovementRequest create(final MovementRequest movementRequest); ResponseEntity<?> updateMovement(final MovementRequest movementRequest); Movement update(final MovementRequest movementRequest); Boolean checkEmployeeExists(final MovementRequest movementRequest); static final Logger LOGGER; }