this.applicationContext.getBean("annSimpleTransferableService", TestService.class);
assertCountersAreZero();
final Date time = new Date();
final ExtendedDataTransferObject dto1 = new AnnotatedExtendedDataTransferObjectImpl();
dto1.setValue("dto1Val1");
dto1.setValue2("dto1Val2");
dto1.setTimestamp(time);
final ExtendedDataTransferObject dto2 = new AnnotatedExtendedDataTransferObjectImpl();
dto2.setValue("dto2Val1");
dto2.setValue2("dto2Val2");
dto2.setTimestamp(time);
final List<ExtendedDataTransferObject> dtos = Arrays.asList(dto1, dto2);
final List<DomainObject> entities = new ArrayList<DomainObject>();
service.dtosToEntitiesBefore(dtos, entities, new Object());
assertEquals(entities.size(), 2);
final DomainObject entity1 = entities.get(0);
assertEquals(entity1.getValue(), "dto1Val1");
assertEquals(entity1.getValue2(), "dto1Val2");
assertNull(entity1.getTimestamp());
final DomainObject entity2 = entities.get(1);
assertEquals(entity2.getValue(), "dto2Val1");
assertEquals(entity2.getValue2(), "dto2Val2");
assertNull(entity2.getTimestamp());
assertEquals(dto1.getValue(), "dto1Val1");
assertEquals(dto1.getValue2(), "dto1Val2");
assertEquals(dto1.getTimestamp(), time);
assertEquals(dto2.getValue(), "dto2Val1");
assertEquals(dto2.getValue2(), "dto2Val2");
assertEquals(dto2.getTimestamp(), time);
// final check counters
assertCounters(0, 0, 0, 2, 2, 0);
}