}
@Test
public void shipmentViolationAtActivity_shouldWorkWhenRemovingPickup(){
buildAnotherScenarioWithOnlyOneVehicleAndWithoutAnyConstraintsBefore();
VehicleRoute route = solution.getRoutes().iterator().next();
SolutionPrinter.print(vrp,solution, SolutionPrinter.Print.VERBOSE);
TourActivity pickupShipment = route.getActivities().get(1);
route.getTourActivities().removeActivity(pickupShipment);
assertFalse(route.getTourActivities().hasActivity(pickupShipment));
SolutionPrinter.print(vrp,solution, SolutionPrinter.Print.VERBOSE);
SolutionAnalyser analyser = new SolutionAnalyser(vrp,solution, new SolutionAnalyser.DistanceCalculator() {
@Override
public double getDistance(String fromLocationId, String toLocationId) {
return vrp.getTransportCosts().getTransportCost(fromLocationId,toLocationId,0.,null,null);
}
});
Boolean violation = analyser.hasShipmentConstraintViolationAtActivity(route.getActivities().get(1), route);
assertTrue(violation);
}