{
// Create misdirected handling event for cargo (receipt in Shanghai is unexpected)
UnitOfWork uow = module.currentUnitOfWork();
HandlingEventsEntity HANDLING_EVENTS = uow.get( HandlingEventsEntity.class, HandlingEventsEntity.HANDLING_EVENTS_ID );
handlingEvent = HANDLING_EVENTS.createHandlingEvent( day( 0 ), day( 0 ), trackingId, HandlingEventType.RECEIVE, SHANGHAI, null );
Delivery delivery = new BuildDeliverySnapshot( cargo, handlingEvent ).get();
cargo.delivery().set( delivery );
assertThat( cargo.delivery().get().isMisdirected().get(), is( equalTo( true ) ) );
logger.info( " Handling cargo 'ABC' (misdirected):" );
new InspectCargo( handlingEvent ).inspect();