### Question:
AlertsService { public void createAlert(final LowStockAlert lowStockAlert) { dbUtil.withDao(LowStockAlert.class, new DbUtil.Operation<LowStockAlert, Object>() { @Override public Object operate(Dao<LowStockAlert, String> dao) throws SQLException { dao.create(lowStockAlert); return null; } }); }  List<LowStockAlert> getLowStockAlerts(); List<LowStockAlert> getEnabledLowStockAlerts(); int numberOfAlerts(); int getNumberOfRoutineOrderAlerts(); List<LowStockAlert> getTop5LowStockAlerts(); void updateLowStockAlerts(); void updateCommodityLowStockAlert(Commodity commodity); void updateCache(); void disableAlertsForCommodities(List<Commodity> commodities); void disableAllRoutineOrderAlerts(); ImmutableList<LowStockAlert> getLowStockAlertsForCommodities(final List<Commodity> commodities); void createAlert(final LowStockAlert lowStockAlert); void disableLowStockAlert(LowStockAlert alert); void deleteLowStockAlert(final LowStockAlert alert); void updateLowStockAlert(final LowStockAlert lowStockAlert); List<OrderCommodityViewModel> getOrderCommodityViewModelsForLowStockAlert(); int getRoutineOrderAlertDay(); void generateRoutineOrderAlert(Date date); List<? extends NotificationMessage> getNotificationMessagesForHomePage(); List<? extends NotificationMessage> getNotificationMessages(); List<MonthlyStockCountAlert> getEnabledMonthlyStockAlerts(); List<OrderCommodityViewModel> getOrderViewModelsForRoutineOrderAlert(); void generateAllocationAlerts(); List<AllocationAlert> getAllocationAlerts(); void deleteAllocationAlert(final Allocation allocation); void generateMonthlyStockCountAlerts(Date date); int getMonthlyStockCountDay(); List<MonthlyStockCountAlert> getMonthlyStockCountAlerts(final Date date); void disableAllMonthlyStockCountAlerts(); static final String DISABLED; static SimpleDateFormat ALERT_DATE_FORMAT; }### Answer:
@Test public void shouldCreateLowStockAlert() throws Exception { setupCommodities(); Commodity commodity = getCommodity(); LowStockAlert alert = new LowStockAlert(commodity); alertsService.createAlert(alert); Long count = dbUtil.withDao(LowStockAlert.class, new DbUtil.Operation<LowStockAlert, Long>() { @Override public Long operate(Dao<LowStockAlert, String> dao) throws SQLException { return dao.countOf(); } }); assertThat(count, is(1L)); }