解决 CartModifierFormhandler 你可以做这样的事情
String[] skuIds = { "sku10011"};
CartModifierFormHandler cmfh = (CartModifierFormHandler) ServletUtil .getCurrentRequest().resolveName("/atg/commerce/order/purchase/CartModifierFormHandler");
cmfh.setCatalogRefIds(skuIds);
cmfh.setProductId("prod10010");
cmfh.setQuantity(12);
cmfh.handleAddItemToOrder(ServletUtil.getCurrentRequest(),
ServletUtil.getCurrentResponse());
order = cmfh.getOrder();
DynamoHttpServletRequest request = ServletUtil.getCurrentRequest();
request.setParameter("sku2", "13");
// Set the new quantity for the commerce item being updated.
cmfh.setCheckForChangedQuantity(true);
DynamoHttpServletResponse response = request.getResponse();
cmfh.handleSetOrder(request, response);
List<CommerceItem> commerceItem = order.getCommerceItems();
double quantity = commerceItem.get(0).getQuantity();
assertEquals(13, quantity, 0);
@Vihung 进行更正