Search in sources :

Example 1 with ParseHandlingEventData

use of org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.parsing.ParseHandlingEventData in project qi4j-sdk by Qi4j.

the class ParseHandlingEventDataTest method prepareTest.

@Before
public void prepareTest() throws Exception {
    super.prepareTest();
    TestApplication.setup();
    UnitOfWork uow = module.currentUnitOfWork();
    CargoAggregateRoot CARGOS = uow.get(CargoAggregateRoot.class, CargoAggregateRoot.CARGOS_ID);
    // Create new cargo
    routeSpec = routeSpecFactory.build(HONGKONG, STOCKHOLM, new Date(), deadline = DAY24);
    delivery = delivery(TODAY, NOT_RECEIVED, ROUTED, unknownLeg);
    cargo = CARGOS.createCargo(routeSpec, delivery, "ABC");
    trackingId = cargo.trackingId().get();
    trackingIdString = trackingId.id().get();
    cargo.itinerary().set(itinerary);
    completionTime = new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date());
    // Start ParseHandlingEventData service
    ServiceReference<ParseHandlingEventData> ParseHandlingEventDataRef = module.findService(ParseHandlingEventData.class);
    handlingEventParser = ParseHandlingEventDataRef.get();
}
Also used : UnitOfWork(org.qi4j.api.unitofwork.UnitOfWork) ParseHandlingEventData(org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.parsing.ParseHandlingEventData) CargoAggregateRoot(org.qi4j.sample.dcicargo.sample_b.data.aggregateroot.CargoAggregateRoot) SimpleDateFormat(java.text.SimpleDateFormat) Date(java.util.Date) Before(org.junit.Before)

Aggregations

SimpleDateFormat (java.text.SimpleDateFormat)1 Date (java.util.Date)1 Before (org.junit.Before)1 UnitOfWork (org.qi4j.api.unitofwork.UnitOfWork)1 ParseHandlingEventData (org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.parsing.ParseHandlingEventData)1 CargoAggregateRoot (org.qi4j.sample.dcicargo.sample_b.data.aggregateroot.CargoAggregateRoot)1