assertEquals("" + domainEvent.occurredOn().getTime(), reader.eventStringValue("occurredOn"));
assertEquals("" + domainEvent.occurredOn().getTime(), reader.eventStringValue("/occurredOn"));
}
public void testReadNestedDomainEventProperties() throws Exception {
TestableNavigableDomainEvent domainEvent = new TestableNavigableDomainEvent(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.eventVersion(), reader.eventIntegerValue("eventVersion").intValue());
assertEquals(domainEvent.eventVersion(), reader.eventIntegerValue("/eventVersion").intValue());
assertEquals("" + domainEvent.nestedEvent().eventVersion(), reader.eventStringValue("nestedEvent", "eventVersion"));
assertEquals("" + domainEvent.nestedEvent().eventVersion(), reader.eventStringValue("/nestedEvent/eventVersion"));
assertEquals(domainEvent.nestedEvent().eventVersion(), reader.eventIntegerValue("nestedEvent", "eventVersion").intValue());
assertEquals(domainEvent.nestedEvent().eventVersion(), reader.eventIntegerValue("/nestedEvent/eventVersion").intValue());
assertEquals("" + domainEvent.nestedEvent().id(), reader.eventStringValue("nestedEvent", "id"));
assertEquals("" + domainEvent.nestedEvent().id(), reader.eventStringValue("/nestedEvent/id"));
assertEquals(domainEvent.nestedEvent().id(), reader.eventLongValue("nestedEvent", "id").longValue());
assertEquals(domainEvent.nestedEvent().id(), reader.eventLongValue("/nestedEvent/id").longValue());
assertEquals("" + domainEvent.nestedEvent().name(), reader.eventStringValue("nestedEvent", "name"));
assertEquals("" + domainEvent.nestedEvent().name(), reader.eventStringValue("/nestedEvent/name"));
assertEquals("" + domainEvent.nestedEvent().occurredOn().getTime(), reader.eventStringValue("nestedEvent", "occurredOn"));
assertEquals("" + domainEvent.nestedEvent().occurredOn().getTime(), reader.eventStringValue("/nestedEvent/occurredOn"));
assertEquals(domainEvent.nestedEvent().occurredOn(), reader.eventDateValue("nestedEvent", "occurredOn"));
assertEquals(domainEvent.nestedEvent().occurredOn(), reader.eventDateValue("/nestedEvent/occurredOn"));
assertEquals("" + domainEvent.occurredOn().getTime(), reader.eventStringValue("occurredOn"));
assertEquals("" + domainEvent.occurredOn().getTime(), reader.eventStringValue("/occurredOn"));
assertEquals(domainEvent.occurredOn(), reader.eventDateValue("occurredOn"));
assertEquals(domainEvent.occurredOn(), reader.eventDateValue("/occurredOn"));
}