Package org.qi4j.sample.dcicargo.sample_b.context.interaction.booking

Examples of org.qi4j.sample.dcicargo.sample_b.context.interaction.booking.BookNewCargo


    public void deviation_4a_TrackingIdTooLong()
        throws Exception
    {
        deviation_4a_TrackingIdNotTooShort();
        thrown.expect( ConstraintViolationException.class, "for value '1234567890123456789012345678901'" );
        new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, DAY24 ).withTrackingId( "1234567890123456789012345678901" );
    }
View Full Code Here


    public void deviation_4a_TrackingIdNotTooLong()
        throws Exception
    {
        deviation_4a_TrackingIdTooLong();
        UnitOfWork uow = module.currentUnitOfWork();
        trackingId = new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, DAY24 ).withTrackingId( "123456789012345678901234567890" );
        cargo = uow.get( CargoEntity.class, trackingId.id().get() );
        assertThat( cargo.trackingId().get().id().get(), is( equalTo( "123456789012345678901234567890" ) ) );
    }
View Full Code Here

    public void deviation_4a_TrackingIdWithWrongCharacter()
        throws Exception
    {
        deviation_4a_TrackingIdNotTooLong();
        thrown.expect( ConstraintViolationException.class, "for value 'Göteborg1234'" );
        new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, DAY24 ).withTrackingId( "Göteborg1234" );
    }
View Full Code Here

    public void deviation_4b_TrackingIdNotUnique()
        throws Exception
    {
        deviation_4a_TrackingIdWithWrongCharacter();
        thrown.expect( CannotCreateCargoException.class, "Tracking id 'yes' is not unique." );
        new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, DAY24 ).withTrackingId( "yes" );
    }
View Full Code Here

    @Test
    public void step_4_CanAutoCreateTrackingIdFromEmptyString()
        throws Exception
    {
        deviation_4b_TrackingIdNotUnique();
        new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, DAY24 ).withTrackingId( "" );
    }
View Full Code Here

    @Test
    public void step_4_CanAutoCreateTrackingIdFromNull()
        throws Exception
    {
        step_4_CanAutoCreateTrackingIdFromEmptyString();
        new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, DAY24 ).withTrackingId( null );
    }
View Full Code Here

    public void success_BookNewCargo()
        throws Exception
    {
        step_4_CanAutoCreateTrackingIdFromNull();
        UnitOfWork uow = module.currentUnitOfWork();
        trackingId = new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, DAY24 ).withTrackingId( "ABC" );
        cargo = uow.get( CargoEntity.class, trackingId.id().get() );

        assertThat( cargo.trackingId().get(), is( equalTo( trackingId ) ) );
        assertThat( cargo.trackingId().get().id().get(), is( equalTo( "ABC" ) ) );
        assertThat( cargo.origin().get(), is( equalTo( HONGKONG ) ) );
View Full Code Here

TOP

Related Classes of org.qi4j.sample.dcicargo.sample_b.context.interaction.booking.BookNewCargo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.