}
}
@Test
public void testCreate() {
final Tyre tyre = createTyre(19D, "P Zero", "235/40ZR19", "Pirelli", BigDecimal.valueOf(420));
TyreTO tto = mapper.map(tyre, TyreTO.class);
service.create(tto);
verify(dao).create(argThat(new BaseMatcher<Tyre>() {
@Override
public boolean matches(Object item) {
if (!(item instanceof Tyre)) {
return false;
}
final Tyre t = (Tyre) item;
if (!Objects.equals(t.getDiameter(), tyre.getDiameter())) {
return false;
}
if (!Objects.equals(t.getName(), tyre.getName())) {
return false;
}
if (!Objects.equals(t.getPrice(), tyre.getPrice())) {
return false;
}
if (!Objects.equals(t.getType(), tyre.getType())) {
return false;
}
if (!Objects.equals(t.getVendor(), tyre.getVendor())) {
return false;
}
return true;
}