assertEquals("vehLoc",route.getEnd().getLocationId());
}
@Test
public void whenBuildingOpenRoute_routeEndShouldHaveLocationOfLastActivity(){
Shipment s = mock(Shipment.class);
Shipment s2 = mock(Shipment.class);
Capacity capacity = Capacity.Builder.newInstance().build();
when(s.getSize()).thenReturn(capacity);
when(s2.getSize()).thenReturn(capacity);
when(s2.getDeliveryLocationId()).thenReturn("delLoc");
Vehicle vehicle = mock(Vehicle.class);
when(vehicle.isReturnToDepot()).thenReturn(false);
when(vehicle.getStartLocationId()).thenReturn("vehLoc");
VehicleRoute.Builder builder = VehicleRoute.Builder.newInstance(vehicle, mock(Driver.class));
builder.addPickup(s);
builder.addPickup(s2);
builder.addDelivery(s);
builder.addDelivery(s2);
VehicleRoute route = builder.build();
assertEquals(route.getEnd().getLocationId(), s2.getDeliveryLocationId());
}