@Test public void getInventoryQuantity_shouldFindInventoryQuantityByItemId() { int quantity = persistence.getInventoryQuantity(existingItem.getItemId()); assertThat(quantity, is(existingItem.getQuantity())); }
@Override public int getInventoryQuantity(@Nonnull final String itemId) { int result = -1; Item item = getItem(itemId); if (item != null) { result = item.getQuantity(); } logger.info("Read quantity[{}] for item[{}]", result, itemId); return result; }
ItemBasePersistence extends AbstractBasePersistence<Item, String> implements ItemMapper { @Override public int getInventoryQuantity(@Nonnull final String itemId) { int result = -1; Item item = getItem(itemId); if (item != null) { result = item.getQuantity(); } logger.info("Read quantity[{}] for item[{}]", result, itemId); return result; } }
ItemBasePersistence extends AbstractBasePersistence<Item, String> implements ItemMapper { @Override public int getInventoryQuantity(@Nonnull final String itemId) { int result = -1; Item item = getItem(itemId); if (item != null) { result = item.getQuantity(); } logger.info("Read quantity[{}] for item[{}]", result, itemId); return result; }  }
ItemBasePersistence extends AbstractBasePersistence<Item, String> implements ItemMapper { @Override public int getInventoryQuantity(@Nonnull final String itemId) { int result = -1; Item item = getItem(itemId); if (item != null) { result = item.getQuantity(); } logger.info("Read quantity[{}] for item[{}]", result, itemId); return result; }  @Override void updateInventoryQuantity(@Nonnull final Map<String, Object> param); @Override int getInventoryQuantity(@Nonnull final String itemId); @Override List<Item> getItemListByProduct(@Nonnull final String productId); @Override Item getItem(@Nonnull final String itemId); }
ItemBasePersistence extends AbstractBasePersistence<Item, String> implements ItemMapper { @Override public int getInventoryQuantity(@Nonnull final String itemId) { int result = -1; Item item = getItem(itemId); if (item != null) { result = item.getQuantity(); } logger.info("Read quantity[{}] for item[{}]", result, itemId); return result; }  @Override void updateInventoryQuantity(@Nonnull final Map<String, Object> param); @Override int getInventoryQuantity(@Nonnull final String itemId); @Override List<Item> getItemListByProduct(@Nonnull final String productId); @Override Item getItem(@Nonnull final String itemId);  }