### Question:
OrderService implements OrderItemSaver { public void saveOrder(final Order order) { dbUtil.withDao(Order.class, new DbUtil.Operation<Order, Void>() { @Override public Void operate(Dao<Order, String> dao) throws SQLException { dao.create(order); return null; } }); order.saveOrderItems(this); if (!order.getOrderType().isRoutine()) { alertsService.disableAlertsForCommodities(getCommoditiesInOrder(order)); } else if (order.getOrderType().isRoutine()) { alertsService.disableAllRoutineOrderAlerts(); } }  List<OrderReason> syncOrderReasons(); List<OrderType> allOrderTypes(); List<OrderReason> allOrderReasons(); List<Order> all(); String getNextSRVNumber(); void saveOrder(final Order order); @Override void saveOrderItem(final OrderItem orderItem); void syncOrderTypes();  }### Answer:
@Test public void shouldMakeSnapShotOfOrderItemWhenItIsSaved() throws Exception { Order order = createOrder(); assertThat(snapshotGenericDao.countOf(), is(0L)); orderService.saveOrder(order); Order returnedOrder = orderDao.queryForSameId(order); assertThat(orderDao.countOf(), is(1L)); assertThat(returnedOrder.getSrvNumber(), is(order.getSrvNumber())); assertThat(snapshotGenericDao.countOf(), is(2L)); }
@Test public void shouldPersistAnOrder() throws SQLException { Order order = createOrder(); orderService.saveOrder(order); Order returnedOrder = orderDao.queryForSameId(order); assertThat(orderDao.countOf(), is(1L)); assertThat(returnedOrder.getSrvNumber(), is(order.getSrvNumber())); assertThat(orderItemDao.queryForAll().get(0).getQuantity(), is(QUANTITY)); }