@Test public void getProduct_shouldFindExistingProduct() { Product existingProduct = createProductBuilderWithAllFields().build(); insertProduct(existingProduct); Product product = productDao.getProduct(existingProduct.getProductId()); assertReflectionEquals(existingProduct, product); }
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);  }