Search in sources :

Example 16 with OrderContents

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

the class OrderRequestImplTest method testUnsetDestName.

@Test
public void testUnsetDestName() throws SystemFault, ProcessingFault {
    OrderContents order = getUncompressedTestOrder();
    order.pSpec.package_identifier = null;
    DeliveryDetails deliveryDetail = new DeliveryDetails();
    deliveryDetail.dests = getBadHttpDestination();
    order.del_list = new DeliveryDetails[] { deliveryDetail };
    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) DeliveryDetails(org.codice.alliance.nsili.common.GIAS.DeliveryDetails) Test(org.junit.Test)

Example 17 with OrderContents

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

the class OrderRequestImplTest method testSingleTarGZipOrder.

@Test
public void testSingleTarGZipOrder() throws SystemFault, ProcessingFault {
    OrderContents order = getUncompressedTestOrder();
    order.pSpec.packaging_format_and_compression = PackagingSpecFormatType.TARGZIP.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 18 with OrderContents

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

the class OrderRequestImplTest method testSupportedEmailDelivery.

@Test
public void testSupportedEmailDelivery() throws SystemFault, ProcessingFault {
    OrderContents order = getUncompressedTestOrder();
    DeliveryDetails deliveryDetail = new DeliveryDetails();
    deliveryDetail.dests = getGoodEmailDestination();
    order.del_list = new DeliveryDetails[] { deliveryDetail };
    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) DeliveryDetails(org.codice.alliance.nsili.common.GIAS.DeliveryDetails) Test(org.junit.Test)

Example 19 with OrderContents

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

the class OrderRequestImplTest method testGetStatus.

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

Example 20 with OrderContents

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

the class OrderRequestImplTest method getMultipleUncompressedTestOrder.

private OrderContents getMultipleUncompressedTestOrder() {
    OrderContents order = new OrderContents();
    PackagingSpec packagingSpec = new PackagingSpec();
    packagingSpec.package_identifier = "pkg1234";
    packagingSpec.packaging_format_and_compression = PackagingSpecFormatType.FILESUNC.name();
    order.pSpec = packagingSpec;
    ProductDetails productDetail1 = new ProductDetails();
    productDetail1.aProduct = mockProduct1;
    ProductDetails productDetail2 = new ProductDetails();
    productDetail2.aProduct = mockProduct2;
    order.prod_list = new ProductDetails[] { productDetail1, productDetail2 };
    DeliveryDetails deliveryDetail = new DeliveryDetails();
    deliveryDetail.dests = getTestDestination();
    order.del_list = new DeliveryDetails[] { deliveryDetail };
    return order;
}
Also used : OrderContents(org.codice.alliance.nsili.common.GIAS.OrderContents) ProductDetails(org.codice.alliance.nsili.common.GIAS.ProductDetails) DeliveryDetails(org.codice.alliance.nsili.common.GIAS.DeliveryDetails) PackagingSpec(org.codice.alliance.nsili.common.GIAS.PackagingSpec)

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