itemDao.updateAllQuantitiesFromOrder(order);
assertFalse("Expected item to be out of stock.", itemDao.isItemInStock(MUTABLE_ITEM_ID));
}
public void testShouldUpdateInventoryForItem() {
Item item = itemDao.getItem(MUTABLE_ITEM_ID);
int inventory = item.getQuantity();
Order order = DomainFixture.newTestOrder();
inventory -= ((LineItem)order.getLineItems().get(0)).getQuantity();
itemDao.updateAllQuantitiesFromOrder(order);
item = itemDao.getItem(MUTABLE_ITEM_ID);
assertEquals(inventory, item.getQuantity());
}