Search in sources :

Example 6 with CargoAggregateRoot

use of org.qi4j.sample.dcicargo.sample_b.data.aggregateroot.CargoAggregateRoot in project qi4j-sdk by Qi4j.

the class RegisterHandlingEventTest method prepareTest.

@Before
public void prepareTest() throws Exception {
    super.prepareTest();
    UnitOfWork uow = module.currentUnitOfWork();
    HANDLING_EVENTS = uow.get(HandlingEventAggregateRoot.class, HandlingEventAggregateRoot.HANDLING_EVENTS_ID);
    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");
    cargo.itinerary().set(itinerary);
    trackingId = cargo.trackingId().get();
}
Also used : HandlingEventAggregateRoot(org.qi4j.sample.dcicargo.sample_b.data.aggregateroot.HandlingEventAggregateRoot) UnitOfWork(org.qi4j.api.unitofwork.UnitOfWork) CargoAggregateRoot(org.qi4j.sample.dcicargo.sample_b.data.aggregateroot.CargoAggregateRoot) Date(java.util.Date) Before(org.junit.Before)

Example 7 with CargoAggregateRoot

use of org.qi4j.sample.dcicargo.sample_b.data.aggregateroot.CargoAggregateRoot in project qi4j-sdk by Qi4j.

the class InspectClaimedCargoTest method prepareTest.

@Before
public void prepareTest() throws Exception {
    super.prepareTest();
    UnitOfWork uow = module.currentUnitOfWork();
    HANDLING_EVENTS = uow.get(HandlingEventAggregateRoot.class, HandlingEventAggregateRoot.HANDLING_EVENTS_ID);
    CargoAggregateRoot CARGOS = uow.get(CargoAggregateRoot.class, CargoAggregateRoot.CARGOS_ID);
    // Create new cargo
    routeSpec = routeSpecFactory.build(HONGKONG, STOCKHOLM, new Date(), deadline = DAY24);
    delivery = delivery(TODAY, IN_PORT, ROUTED, leg1);
    cargo = CARGOS.createCargo(routeSpec, delivery, "Claimed_CARGO");
    trackingId = cargo.trackingId().get();
}
Also used : HandlingEventAggregateRoot(org.qi4j.sample.dcicargo.sample_b.data.aggregateroot.HandlingEventAggregateRoot) UnitOfWork(org.qi4j.api.unitofwork.UnitOfWork) CargoAggregateRoot(org.qi4j.sample.dcicargo.sample_b.data.aggregateroot.CargoAggregateRoot) Date(java.util.Date) Before(org.junit.Before)

Example 8 with CargoAggregateRoot

use of org.qi4j.sample.dcicargo.sample_b.data.aggregateroot.CargoAggregateRoot in project qi4j-sdk by Qi4j.

the class AssignCargoToRouteTest method prepareTest.

@Before
public void prepareTest() throws Exception {
    super.prepareTest();
    UnitOfWork uow = module.currentUnitOfWork();
    HANDLING_EVENTS = uow.get(HandlingEventAggregateRoot.class, HandlingEventAggregateRoot.HANDLING_EVENTS_ID);
    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, NOT_ROUTED, unknownLeg);
    cargo = CARGOS.createCargo(routeSpec, delivery, "ABC");
    trackingId = cargo.trackingId().get();
    delivery = cargo.delivery().get();
}
Also used : HandlingEventAggregateRoot(org.qi4j.sample.dcicargo.sample_b.data.aggregateroot.HandlingEventAggregateRoot) UnitOfWork(org.qi4j.api.unitofwork.UnitOfWork) CargoAggregateRoot(org.qi4j.sample.dcicargo.sample_b.data.aggregateroot.CargoAggregateRoot) Date(java.util.Date) Before(org.junit.Before)

Example 9 with CargoAggregateRoot

use of org.qi4j.sample.dcicargo.sample_b.data.aggregateroot.CargoAggregateRoot in project qi4j-sdk by Qi4j.

the class InspectCargoInCustomsTest method prepareTest.

@Before
public void prepareTest() throws Exception {
    super.prepareTest();
    UnitOfWork uow = module.currentUnitOfWork();
    HANDLING_EVENTS = uow.get(HandlingEventAggregateRoot.class, HandlingEventAggregateRoot.HANDLING_EVENTS_ID);
    CargoAggregateRoot CARGOS = uow.get(CargoAggregateRoot.class, CargoAggregateRoot.CARGOS_ID);
    // Create new cargo
    routeSpec = routeSpecFactory.build(HONGKONG, STOCKHOLM, new Date(), deadline = DAY24);
    delivery = delivery(TODAY, IN_PORT, ROUTED, leg1);
    cargo = CARGOS.createCargo(routeSpec, delivery, "CARGO_in_customs");
    trackingId = cargo.trackingId().get();
}
Also used : HandlingEventAggregateRoot(org.qi4j.sample.dcicargo.sample_b.data.aggregateroot.HandlingEventAggregateRoot) UnitOfWork(org.qi4j.api.unitofwork.UnitOfWork) CargoAggregateRoot(org.qi4j.sample.dcicargo.sample_b.data.aggregateroot.CargoAggregateRoot) Date(java.util.Date) Before(org.junit.Before)

Example 10 with CargoAggregateRoot

use of org.qi4j.sample.dcicargo.sample_b.data.aggregateroot.CargoAggregateRoot 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

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