@Test void addVehicle() { final Vehicle vehicle = VehicleFactory.testVehicle(1); vehicleService.addVehicle(vehicle); verifyNoInteractions(vehicleRepository); verify(optimizer).addVehicle(vehicle); }
public void addVehicle(Vehicle vehicle) { optimizer.addVehicle(Objects.requireNonNull(vehicle)); }
VehicleService { public void addVehicle(Vehicle vehicle) { optimizer.addVehicle(Objects.requireNonNull(vehicle)); } }
VehicleService { public void addVehicle(Vehicle vehicle) { optimizer.addVehicle(Objects.requireNonNull(vehicle)); } @Autowired  VehicleService(RouteOptimizer optimizer, VehicleRepository vehicleRepository); }
VehicleService { public void addVehicle(Vehicle vehicle) { optimizer.addVehicle(Objects.requireNonNull(vehicle)); } @Autowired  VehicleService(RouteOptimizer optimizer, VehicleRepository vehicleRepository); void createVehicle(); void createVehicle(VehicleData vehicleData); void addVehicle(Vehicle vehicle); void removeVehicle(long vehicleId); synchronized void removeAnyVehicle(); void removeAll(); void changeCapacity(long vehicleId, int capacity); }
VehicleService { public void addVehicle(Vehicle vehicle) { optimizer.addVehicle(Objects.requireNonNull(vehicle)); } @Autowired  VehicleService(RouteOptimizer optimizer, VehicleRepository vehicleRepository); void createVehicle(); void createVehicle(VehicleData vehicleData); void addVehicle(Vehicle vehicle); void removeVehicle(long vehicleId); synchronized void removeAnyVehicle(); void removeAll(); void changeCapacity(long vehicleId, int capacity);  }