}
}
@Test
public void testCreate() {
final ExtraService es = newService("Window cleaning", "Thorough window and mirror cleaning", BigDecimal.valueOf(22.2));
ExtraServiceTO esto = mapper.map(es, ExtraServiceTO.class);
//
service.create(esto);
verify(dao).create(argThat(new BaseMatcher<ExtraService>() {
@Override
public boolean matches(Object item) {
if (!(item instanceof ExtraService)) {
return false;
}
final ExtraService other = (ExtraService) item;
if (!Objects.equals(es.getId(), other.getId())) {
return false;
}
if (!Objects.equals(es.getName(), other.getName())) {
return false;
}
if (!Objects.equals(es.getDescription(), other.getDescription())) {
return false;
}
if (es.getPrice().compareTo(other.getPrice()) != 0) {
return false;
}
return true;
}