Search in sources :

Example 16 with DeliveryManifestHolder

use of org.codice.alliance.nsili.common.GIAS.DeliveryManifestHolder 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 17 with DeliveryManifestHolder

use of org.codice.alliance.nsili.common.GIAS.DeliveryManifestHolder 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 18 with DeliveryManifestHolder

use of org.codice.alliance.nsili.common.GIAS.DeliveryManifestHolder 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)

Example 19 with DeliveryManifestHolder

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

the class OrderRequestImplTest method testSingleUncompressedOrder.

@Test
public void testSingleUncompressedOrder() throws SystemFault, ProcessingFault {
    OrderContents order = getUncompressedTestOrder();
    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 20 with DeliveryManifestHolder

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

the class OrderRequestImplTest method testNoPSpec.

@Test
public void testNoPSpec() throws SystemFault, ProcessingFault {
    OrderContents order = getUncompressedTestOrder();
    order.pSpec = null;
    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)

Aggregations

DeliveryManifestHolder (org.codice.alliance.nsili.common.GIAS.DeliveryManifestHolder)22 OrderContents (org.codice.alliance.nsili.common.GIAS.OrderContents)22 Test (org.junit.Test)21 DeliveryDetails (org.codice.alliance.nsili.common.GIAS.DeliveryDetails)2 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 URISyntaxException (java.net.URISyntaxException)1 KeyManagementException (java.security.KeyManagementException)1 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)1 CertificateException (java.security.cert.CertificateException)1 DeliveryManifest (org.codice.alliance.nsili.common.GIAS.DeliveryManifest)1 OrderRequest (org.codice.alliance.nsili.common.GIAS.OrderRequest)1 PackageElement (org.codice.alliance.nsili.common.GIAS.PackageElement)1 ValidationResults (org.codice.alliance.nsili.common.GIAS.ValidationResults)1 NameValue (org.codice.alliance.nsili.common.UCO.NameValue)1 Product (org.codice.alliance.nsili.common.UID.Product)1 Any (org.omg.CORBA.Any)1