@Test(expected = NullPointerException.class) public void getProduct_shouldThrowNPEForEmptyProductIdArgument() { productDao.getProduct(""); }
public Product getProduct(final String productId) { checkNotNull(emptyToNull(productId), "Argument[productId] must not be empty or null"); Product product = super.read(productId); logger.info("Found for id [{}] following product[{}]", productId, product); return product; }
ProductDao extends AbstractBaseDao<Product, String> implements ProductMapper { public Product getProduct(final String productId) { checkNotNull(emptyToNull(productId), "Argument[productId] must not be empty or null"); Product product = super.read(productId); logger.info("Found for id [{}] following product[{}]", productId, product); return product; } }
ProductDao extends AbstractBaseDao<Product, String> implements ProductMapper { public Product getProduct(final String productId) { checkNotNull(emptyToNull(productId), "Argument[productId] must not be empty or null"); Product product = super.read(productId); logger.info("Found for id [{}] following product[{}]", productId, product); return product; } ProductDao(final String collectionName); }
ProductDao extends AbstractBaseDao<Product, String> implements ProductMapper { public Product getProduct(final String productId) { checkNotNull(emptyToNull(productId), "Argument[productId] must not be empty or null"); Product product = super.read(productId); logger.info("Found for id [{}] following product[{}]", productId, product); return product; } ProductDao(final String collectionName); List<Product> getProductListByCategory(final String categoryId); Product getProduct(final String productId); List<Product> searchProductList(final String keyword); }
ProductDao extends AbstractBaseDao<Product, String> implements ProductMapper { public Product getProduct(final String productId) { checkNotNull(emptyToNull(productId), "Argument[productId] must not be empty or null"); Product product = super.read(productId); logger.info("Found for id [{}] following product[{}]", productId, product); return product; } ProductDao(final String collectionName); List<Product> getProductListByCategory(final String categoryId); Product getProduct(final String productId); List<Product> searchProductList(final String keyword);  }