assertThat( delivery.isUnloadedAtDestination().get(), is( equalTo( false ) ) );
// Cargo needs to be rerouted
// Customer specifies a new route
RouteSpecification routeSpec = routeSpecification( TOKYO, STOCKHOLM, day( 20 ) );
cargo.routeSpecification().set( routeSpec );
delivery = new BuildDeliverySnapshot( cargo ).get();
cargo.delivery().set( delivery );
// Old itinerary will not satisfy new route specification
assertThat( itinerary.firstLeg().loadLocation().get(), is( not( equalTo( routeSpec.origin().get() ) ) ) );
assertThat( itinerary.lastLeg().unloadLocation().get(), is( equalTo( routeSpec.destination().get() ) ) );
assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.MISROUTED ) ) );
// Old planned arrival time is still satisfying new deadline
assertTrue( routeSpec.arrivalDeadline().get().after( itinerary.finalArrivalDate() ) );
// We don't know what's next before a new itinerary has been chosen
assertThat( delivery.nextExpectedHandlingEvent().get(), is( equalTo( null ) ) );
assertThat( delivery.eta().get(), is( equalTo( null ) ) );