@Test public void testAddItem() throws Exception { assertFalse(cart.isEmpty()); assertEquals(BigDecimal.valueOf(2.0), cart.getTotalSum()); }
@Override public CartItemInfo addItem(ProductInfo productInfo) { CartItemInfo cartItemInfo = new CartItemInfo(productInfo); getAllItems().add(cartItemInfo); return cartItemInfo; }
InMemoryCartFulfillmentProviderImpl extends AbstractFulfillmentProvider implements CartFulfillmentProvider { @Override public CartItemInfo addItem(ProductInfo productInfo) { CartItemInfo cartItemInfo = new CartItemInfo(productInfo); getAllItems().add(cartItemInfo); return cartItemInfo; } }
InMemoryCartFulfillmentProviderImpl extends AbstractFulfillmentProvider implements CartFulfillmentProvider { @Override public CartItemInfo addItem(ProductInfo productInfo) { CartItemInfo cartItemInfo = new CartItemInfo(productInfo); getAllItems().add(cartItemInfo); return cartItemInfo; } InMemoryCartFulfillmentProviderImpl(); }
InMemoryCartFulfillmentProviderImpl extends AbstractFulfillmentProvider implements CartFulfillmentProvider { @Override public CartItemInfo addItem(ProductInfo productInfo) { CartItemInfo cartItemInfo = new CartItemInfo(productInfo); getAllItems().add(cartItemInfo); return cartItemInfo; } InMemoryCartFulfillmentProviderImpl(); @Override CartItemInfo addItem(ProductInfo productInfo); @Override void removeItem(CartItemInfo item); @Override List<CartItemInfo> getAll(); @Override void clear(); @Override boolean isEmpty(); @Override List<CartItemInfo> getAllItems(); }
InMemoryCartFulfillmentProviderImpl extends AbstractFulfillmentProvider implements CartFulfillmentProvider { @Override public CartItemInfo addItem(ProductInfo productInfo) { CartItemInfo cartItemInfo = new CartItemInfo(productInfo); getAllItems().add(cartItemInfo); return cartItemInfo; } InMemoryCartFulfillmentProviderImpl(); @Override CartItemInfo addItem(ProductInfo productInfo); @Override void removeItem(CartItemInfo item); @Override List<CartItemInfo> getAll(); @Override void clear(); @Override boolean isEmpty(); @Override List<CartItemInfo> getAllItems();  }