Search in sources :

Example 11 with DeliveryManifestHolder

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

the class OrderRequestImplTest method testMultipleTarZipOrder.

@Test
public void testMultipleTarZipOrder() throws SystemFault, ProcessingFault {
    OrderContents order = getMultipleUncompressedTestOrder();
    order.pSpec.packaging_format_and_compression = PackagingSpecFormatType.TARZIP.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 12 with DeliveryManifestHolder

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

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

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

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

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