use of org.codice.alliance.nsili.common.GIAS.OrderContents in project alliance by codice.
the class OrderRequestImplTest method getUncompressedTestOrder.
private OrderContents getUncompressedTestOrder() {
OrderContents order = new OrderContents();
PackagingSpec packagingSpec = new PackagingSpec();
packagingSpec.package_identifier = "pkg1234";
packagingSpec.packaging_format_and_compression = PackagingSpecFormatType.FILESUNC.name();
order.pSpec = packagingSpec;
ProductDetails productDetail = new ProductDetails();
productDetail.aProduct = mockProduct1;
order.prod_list = new ProductDetails[] { productDetail };
DeliveryDetails deliveryDetail = new DeliveryDetails();
deliveryDetail.dests = getTestDestination();
order.del_list = new DeliveryDetails[] { deliveryDetail };
return order;
}
use of org.codice.alliance.nsili.common.GIAS.OrderContents in project alliance by codice.
the class OrderRequestImplTest method testMultipleCompressedOrder.
@Test
public void testMultipleCompressedOrder() throws SystemFault, ProcessingFault {
OrderContents order = getMultipleUncompressedTestOrder();
order.pSpec.packaging_format_and_compression = PackagingSpecFormatType.FILESCOMPRESS.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(2));
}
use of org.codice.alliance.nsili.common.GIAS.OrderContents in project alliance by codice.
the class OrderRequestImplTest method testSetUserInfo.
@Test
public void testSetUserInfo() throws InvalidInputParameter, SystemFault, ProcessingFault {
OrderContents order = getUncompressedTestOrder();
OrderRequestImpl orderRequest = new OrderRequestImpl(order, PROTOCOL, PORT, accessManager, mockCatalogFramework, emailConfiguration);
orderRequest.set_user_info("test user");
}
use of org.codice.alliance.nsili.common.GIAS.OrderContents in project alliance by codice.
the class OrderRequestImplTest method testUnsetOutputName.
@Test
public void testUnsetOutputName() throws SystemFault, ProcessingFault {
OrderContents order = getUncompressedTestOrder();
order.pSpec.package_identifier = 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));
}
use of org.codice.alliance.nsili.common.GIAS.OrderContents 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));
}
Aggregations