Search in sources :

Example 21 with OrderContents

use of org.codice.alliance.nsili.common.GIAS.OrderContents in project alliance by codice.

the class OrderRequestImplTest method testSingleTarUncompressedOrder.

@Test
public void testSingleTarUncompressedOrder() throws SystemFault, ProcessingFault {
    OrderContents order = getUncompressedTestOrder();
    order.pSpec.packaging_format_and_compression = PackagingSpecFormatType.TARUNC.name();
    OrderRequestImpl orderRequest = new OrderRequestImpl(order, accessManager, mockCatalogFramework, destination -> Optional.of(mock(DestinationSink.class)));
    DeliveryManifestHolder holder = new DeliveryManifestHolder();
    orderRequest.complete(holder);
    assertThat(holder.value, notNullValue());
    assertThat(holder.value.elements[0].files.length, is(1));
}
Also used : OrderContents(org.codice.alliance.nsili.common.GIAS.OrderContents) DeliveryManifestHolder(org.codice.alliance.nsili.common.GIAS.DeliveryManifestHolder) Test(org.junit.Test)

Example 22 with OrderContents

use of org.codice.alliance.nsili.common.GIAS.OrderContents in project alliance by codice.

the class OrderRequestImplTest method testMultipleUncompressedOrder.

@Test
public void testMultipleUncompressedOrder() throws SystemFault, ProcessingFault {
    OrderContents order = getMultipleUncompressedTestOrder();
    OrderRequestImpl orderRequest = new OrderRequestImpl(order, accessManager, mockCatalogFramework, destination -> Optional.of(mock(DestinationSink.class)));
    DeliveryManifestHolder holder = new DeliveryManifestHolder();
    orderRequest.complete(holder);
    assertThat(holder.value, notNullValue());
    assertThat(holder.value.elements[0].files.length, is(2));
}
Also used : OrderContents(org.codice.alliance.nsili.common.GIAS.OrderContents) DeliveryManifestHolder(org.codice.alliance.nsili.common.GIAS.DeliveryManifestHolder) Test(org.junit.Test)

Example 23 with OrderContents

use of org.codice.alliance.nsili.common.GIAS.OrderContents in project alliance by codice.

the class OrderRequestImplTest method testMultipleTarCompressOrder.

@Test
public void testMultipleTarCompressOrder() throws SystemFault, ProcessingFault {
    OrderContents order = getMultipleUncompressedTestOrder();
    order.pSpec.packaging_format_and_compression = PackagingSpecFormatType.TARCOMPRESS.name();
    OrderRequestImpl orderRequest = new OrderRequestImpl(order, accessManager, mockCatalogFramework, destination -> Optional.of(mock(DestinationSink.class)));
    DeliveryManifestHolder holder = new DeliveryManifestHolder();
    orderRequest.complete(holder);
    assertThat(holder.value, notNullValue());
    assertThat(holder.value.elements[0].files.length, is(1));
}
Also used : OrderContents(org.codice.alliance.nsili.common.GIAS.OrderContents) DeliveryManifestHolder(org.codice.alliance.nsili.common.GIAS.DeliveryManifestHolder) Test(org.junit.Test)

Example 24 with OrderContents

use of org.codice.alliance.nsili.common.GIAS.OrderContents in project alliance by codice.

the class OrderRequestImplTest method testCancel.

@Test
public void testCancel() throws SystemFault, ProcessingFault {
    OrderContents order = getUncompressedTestOrder();
    OrderRequestImpl orderRequest = new OrderRequestImpl(order, PROTOCOL, PORT, accessManager, mockCatalogFramework, emailConfiguration);
    orderRequest.cancel();
}
Also used : OrderContents(org.codice.alliance.nsili.common.GIAS.OrderContents) Test(org.junit.Test)

Example 25 with OrderContents

use of org.codice.alliance.nsili.common.GIAS.OrderContents in project alliance by codice.

the class OrderRequestImplTest method testNoProduct.

@Test(expected = BAD_OPERATION.class)
public void testNoProduct() throws SystemFault, ProcessingFault {
    OrderContents order = getUncompressedTestOrder();
    order.prod_list = null;
    OrderRequestImpl orderRequest = new OrderRequestImpl(order, accessManager, mockCatalogFramework, destination -> Optional.of(mock(DestinationSink.class)));
    DeliveryManifestHolder holder = new DeliveryManifestHolder();
    orderRequest.complete(holder);
}
Also used : OrderContents(org.codice.alliance.nsili.common.GIAS.OrderContents) DeliveryManifestHolder(org.codice.alliance.nsili.common.GIAS.DeliveryManifestHolder) Test(org.junit.Test)

Aggregations

OrderContents (org.codice.alliance.nsili.common.GIAS.OrderContents)31 Test (org.junit.Test)26 DeliveryManifestHolder (org.codice.alliance.nsili.common.GIAS.DeliveryManifestHolder)22 DeliveryDetails (org.codice.alliance.nsili.common.GIAS.DeliveryDetails)6 PackagingSpec (org.codice.alliance.nsili.common.GIAS.PackagingSpec)4 ProductDetails (org.codice.alliance.nsili.common.GIAS.ProductDetails)4 Any (org.omg.CORBA.Any)3 Calendar (java.util.Calendar)2 AlterationSpec (org.codice.alliance.nsili.common.GIAS.AlterationSpec)2 Destination (org.codice.alliance.nsili.common.GIAS.Destination)2 ImageSpec (org.codice.alliance.nsili.common.GIAS.ImageSpec)2 MediaType (org.codice.alliance.nsili.common.GIAS.MediaType)2 TailoringSpec (org.codice.alliance.nsili.common.GIAS.TailoringSpec)2 AbsTime (org.codice.alliance.nsili.common.UCO.AbsTime)2 Coordinate2d (org.codice.alliance.nsili.common.UCO.Coordinate2d)2 Date (org.codice.alliance.nsili.common.UCO.Date)2 NameName (org.codice.alliance.nsili.common.UCO.NameName)2 Rectangle (org.codice.alliance.nsili.common.UCO.Rectangle)2 Time (org.codice.alliance.nsili.common.UCO.Time)2 IOException (java.io.IOException)1