assertEquals(notification.version(), reader.version());
assertEquals(domainEvent.eventVersion(), reader.version());
}
public void testReadDomainEventProperties() throws Exception {
TestableDomainEvent domainEvent = new TestableDomainEvent(100, "testing");
Notification notification = new Notification(1, domainEvent);
NotificationSerializer serializer = NotificationSerializer.instance();
String serializedNotification = serializer.serialize(notification);
NotificationReader reader = new NotificationReader(serializedNotification);
assertEquals("" + domainEvent.eventVersion(), reader.eventStringValue("eventVersion"));
assertEquals("" + domainEvent.eventVersion(), reader.eventStringValue("/eventVersion"));
assertEquals("" + domainEvent.id(), reader.eventStringValue("id"));
assertEquals("" + domainEvent.id(), reader.eventStringValue("/id"));
assertEquals("" + domainEvent.name(), reader.eventStringValue("name"));
assertEquals("" + domainEvent.name(), reader.eventStringValue("/name"));
assertEquals("" + domainEvent.occurredOn().getTime(), reader.eventStringValue("occurredOn"));
assertEquals("" + domainEvent.occurredOn().getTime(), reader.eventStringValue("/occurredOn"));
}