// Get the quantity to place in the shopping cart
double qtyToPurchase = (Double) product.get("qtyToPurchase");
// Create the shopping cart product entity
ShoppingCartProductEntity shoppingCartProduct = new ShoppingCartProductEntity();
shoppingCartProduct.setProduct_id(productId + "");
shoppingCartProduct.setQty(qtyToPurchase);
shoppingCartProducts.add(shoppingCartProduct);
productIds.add(productId);
}
testObjects.put("productIds", productIds);
testObjects.put("shoppingCartProducts", shoppingCartProducts);
String storeId = testObjects.get("storeId").toString();
int quoteId = createShoppingCart(storeId);
String orderId = createShoppingCartOrder(quoteId, customer, addresses, paymentMethod, shippingMethod, shoppingCartProducts);
testObjects.put("orderId", orderId);
List<OrderItemIdQty> quantities = new ArrayList<OrderItemIdQty>();
for (ShoppingCartProductEntity shoppingCartProduct : shoppingCartProducts) {
OrderItemIdQty item = new OrderItemIdQty(Integer.parseInt(shoppingCartProduct.getProduct_id()), shoppingCartProduct.getQty());
quantities.add(item);
}
String shipmentId = createOrderShipment(orderId, quantities);
testObjects.put("shipmentId", shipmentId);