Search in sources :

Example 11 with Cargos

use of org.qi4j.sample.dcicargo.sample_a.data.shipping.cargo.Cargos in project qi4j-sdk by Qi4j.

the class BookNewCargoTest method deviation_2b_3_DeadlineTomorrowIsOkay.

@Test
public void deviation_2b_3_DeadlineTomorrowIsOkay() throws Exception {
    UnitOfWork uow = module.currentUnitOfWork();
    Location HONGKONG = uow.get(Location.class, CNHKG.code().get());
    Location STOCKHOLM = uow.get(Location.class, SESTO.code().get());
    Cargos CARGOS = uow.get(Cargos.class, CargosEntity.CARGOS_ID);
    new BookNewCargo(CARGOS, HONGKONG, STOCKHOLM, day(1)).book();
}
Also used : UnitOfWork(org.qi4j.api.unitofwork.UnitOfWork) Cargos(org.qi4j.sample.dcicargo.sample_a.data.shipping.cargo.Cargos) Location(org.qi4j.sample.dcicargo.sample_a.data.shipping.location.Location) Test(org.junit.Test)

Example 12 with Cargos

use of org.qi4j.sample.dcicargo.sample_a.data.shipping.cargo.Cargos in project qi4j-sdk by Qi4j.

the class BookNewCargoTest method deviation2a_OriginAndDestinationSame.

@Test(expected = RouteException.class)
public void deviation2a_OriginAndDestinationSame() throws Exception {
    UnitOfWork uow = module.currentUnitOfWork();
    Location HONGKONG = uow.get(Location.class, CNHKG.code().get());
    Cargos CARGOS = uow.get(Cargos.class, CargosEntity.CARGOS_ID);
    new BookNewCargo(CARGOS, HONGKONG, HONGKONG, day(17)).book();
}
Also used : UnitOfWork(org.qi4j.api.unitofwork.UnitOfWork) Cargos(org.qi4j.sample.dcicargo.sample_a.data.shipping.cargo.Cargos) Location(org.qi4j.sample.dcicargo.sample_a.data.shipping.location.Location) Test(org.junit.Test)

Aggregations

UnitOfWork (org.qi4j.api.unitofwork.UnitOfWork)12 Cargos (org.qi4j.sample.dcicargo.sample_a.data.shipping.cargo.Cargos)12 Location (org.qi4j.sample.dcicargo.sample_a.data.shipping.location.Location)11 Test (org.junit.Test)9 Cargo (org.qi4j.sample.dcicargo.sample_a.data.shipping.cargo.Cargo)8 TrackingId (org.qi4j.sample.dcicargo.sample_a.data.shipping.cargo.TrackingId)4 Itinerary (org.qi4j.sample.dcicargo.sample_a.data.shipping.itinerary.Itinerary)4 Before (org.junit.Before)3 Delivery (org.qi4j.sample.dcicargo.sample_a.data.shipping.delivery.Delivery)3 Voyage (org.qi4j.sample.dcicargo.sample_a.data.shipping.voyage.Voyage)3 BookNewCargo (org.qi4j.sample.dcicargo.sample_a.context.shipping.booking.BookNewCargo)2 Date (java.util.Date)1 RouteSpecification (org.qi4j.sample.dcicargo.sample_a.data.shipping.cargo.RouteSpecification)1