@Test
public void testReduceStocks() {

	ShopProduct product = new ShopProduct();
	product.setContent("content");
	product.setIsValid("Y");
	product.setIsRecommend("Y");
	product.setIsHotProduct("Y");
	product.setMarketPrice(Long.valueOf(11L));
	product.setPointChange(Long.valueOf(12L));
	product.setStocks(Long.valueOf(13L));
	product.setPictures("pictures");
	product.setProductCode("productCode");
	product.setProductName("productName");
	product.setProductType(Constant.SHOP_PRODUCT_TYPE.COUPON.name());
	Long id = shopProductDAO.insert(product);
	
	Map<String, Object> params = new HashMap<String, Object>();
	params.put("productId", id);
	params.put("quantity", 1);
	shopProductDAO.reduceStocks(params);
	
	product = shopProductDAO.queryByPk(id);
	
	Assert.assertEquals(12L, product.getStocks().longValue());	
}