@Test public void shouldInsertShipmentIfNewLineItem() throws Exception { ShipmentLineItem shipmentLineItem = make(a(defaultShipmentLineItem, with(productCode, "P10"), with(orderId, 1L), with(quantityShipped, 500))); shipmentRepository.save(shipmentLineItem); verify(shipmentMapper).insertShippedLineItem(shipmentLineItem); }
public void save(ShipmentLineItem shipmentLineItem) { try { shipmentMapper.insertShippedLineItem(shipmentLineItem); } catch (DataIntegrityViolationException exception) { throw new DataException("error.incorrect.length"); } }
ShipmentRepository { public void save(ShipmentLineItem shipmentLineItem) { try { shipmentMapper.insertShippedLineItem(shipmentLineItem); } catch (DataIntegrityViolationException exception) { throw new DataException("error.incorrect.length"); } } }
ShipmentRepository { public void save(ShipmentLineItem shipmentLineItem) { try { shipmentMapper.insertShippedLineItem(shipmentLineItem); } catch (DataIntegrityViolationException exception) { throw new DataException("error.incorrect.length"); } } @Autowired  ShipmentRepository(ShipmentMapper shipmentMapper); }
ShipmentRepository { public void save(ShipmentLineItem shipmentLineItem) { try { shipmentMapper.insertShippedLineItem(shipmentLineItem); } catch (DataIntegrityViolationException exception) { throw new DataException("error.incorrect.length"); } } @Autowired  ShipmentRepository(ShipmentMapper shipmentMapper); void insertShipmentFileInfo(ShipmentFileInfo shipmentFileInfo); void save(ShipmentLineItem shipmentLineItem); List<ShipmentLineItem> getLineItems(Long orderId); }
ShipmentRepository { public void save(ShipmentLineItem shipmentLineItem) { try { shipmentMapper.insertShippedLineItem(shipmentLineItem); } catch (DataIntegrityViolationException exception) { throw new DataException("error.incorrect.length"); } } @Autowired  ShipmentRepository(ShipmentMapper shipmentMapper); void insertShipmentFileInfo(ShipmentFileInfo shipmentFileInfo); void save(ShipmentLineItem shipmentLineItem); List<ShipmentLineItem> getLineItems(Long orderId);  }