@Test
public void deviation_2d_UnsatisfyingItinerary_wrongOrigin() throws Exception
{
deviation_2c_ItineraryIsUnknown_buildFromNonRoutedCargo();
Itinerary itinerary = itinerary(
leg( V100S, HONGKONG, NEWYORK, day( 1 ), day( 8 ) ),
leg( V200T, NEWYORK, DALLAS, day( 9 ), day( 12 ) ),
leg( V300A, DALLAS, STOCKHOLM, day( 13 ), day( 16 ) )
);
// Hangzhou not in itinerary first leg
RouteSpecification routeSpec = routeSpecification( HANGZHOU, STOCKHOLM, day( 20 ) );
cargo.itinerary().set( itinerary );
cargo.routeSpecification().set( routeSpec );
Delivery delivery = new BuildDeliverySnapshot( cargo ).get();
// Route specification not satisfied by itinerary
assertThat( itinerary.firstLeg().loadLocation().get(), is( not( equalTo( routeSpec.origin().get() ) ) ) );
assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.MISROUTED ) ) );
}