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));
}
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));
}
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));
}
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();
}
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);
}
Aggregations