313314315316317318319320321322323324325326
assertDeepEquals(os.get(i), orders.get(i)); } } private static Tyre newTyre(Double diameter, String name, String type, String vendor, BigDecimal price) { Tyre t = new Tyre(); t.setDiameter(diameter); t.setName(name); t.setType(type); t.setVendor(vendor); t.setPrice(price); return t; }
333435363738394041
} if (tyre.getId() != null) { throw new IllegalArgumentException("tyre.id is not null"); } Tyre tm = mapper.map(tyre, Tyre.class); tyreDAO.create(tm); tyre.setId(tm.getId()); }
4546474849505152535455
public TyreTO get(Long id) { if (id == null) { throw new IllegalArgumentException("Tyre.Id is null"); } Tyre tyre = tyreDAO.get(id); if (tyre == null) { return null; } return mapper.map(tyre, TyreTO.class); }
6263646566676869
throw new IllegalArgumentException("Tyre is null"); } if (tyre.getId() == null) { throw new IllegalArgumentException("Tyre.id is null"); } Tyre tm = mapper.map(tyre, Tyre.class); tyreDAO.update(tm); }
7677787980818283
throw new IllegalArgumentException("Tyre is null"); } if (tyre.getId() == null) { throw new IllegalArgumentException("Tyre.id is null"); } Tyre tm = mapper.map(tyre, Tyre.class); tyreDAO.remove(tm); }