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