@Test public void insertOrder_shouldInsertNewOrderIntoCollection() { Order newOrder = createOrderWithAllFields(); orderDao.insertOrder(newOrder); DBObject orderObj = collection.findOne(new BasicDBObject("_id", newOrder.getOrderId())); assertThat("Cannot find order with id [" + newOrder.getOrderId() + "]", orderObj, notNullValue()); Order persistedOrder = Order.fromDBObject(orderObj); assertReflectionEquals(newOrder, persistedOrder); }
public void insertOrder(@Nonnull final Order order) { checkNotNull(order, "Argument[order] must not be null"); super.create(order); logger.info("Inserted new order[{}]", order); }
OrderDao extends AbstractBaseDao<Order, Integer> implements OrderMapper, LineItemMapper { public void insertOrder(@Nonnull final Order order) { checkNotNull(order, "Argument[order] must not be null"); super.create(order); logger.info("Inserted new order[{}]", order); } }
OrderDao extends AbstractBaseDao<Order, Integer> implements OrderMapper, LineItemMapper { public void insertOrder(@Nonnull final Order order) { checkNotNull(order, "Argument[order] must not be null"); super.create(order); logger.info("Inserted new order[{}]", order); } OrderDao(@Nonnull final String collectionName); }
OrderDao extends AbstractBaseDao<Order, Integer> implements OrderMapper, LineItemMapper { public void insertOrder(@Nonnull final Order order) { checkNotNull(order, "Argument[order] must not be null"); super.create(order); logger.info("Inserted new order[{}]", order); } OrderDao(@Nonnull final String collectionName); List<LineItem> getLineItemsByOrderId(final int orderId); void insertLineItem(@Nonnull final LineItem lineItem); List<Order> getOrdersByUsername(@Nonnull final String username); Order getOrder(final int orderId); void insertOrder(@Nonnull final Order order); void insertOrderStatus(@Nonnull final Order order); }
OrderDao extends AbstractBaseDao<Order, Integer> implements OrderMapper, LineItemMapper { public void insertOrder(@Nonnull final Order order) { checkNotNull(order, "Argument[order] must not be null"); super.create(order); logger.info("Inserted new order[{}]", order); } OrderDao(@Nonnull final String collectionName); List<LineItem> getLineItemsByOrderId(final int orderId); void insertLineItem(@Nonnull final LineItem lineItem); List<Order> getOrdersByUsername(@Nonnull final String username); Order getOrder(final int orderId); void insertOrder(@Nonnull final Order order); void insertOrderStatus(@Nonnull final Order order);  }