@Test
public void deserializeThingCreatedV1() {

    final JsonObject eventJson = JsonFactory.newObjectBuilder()
            .set("event", ThingCreated.NAME)
            .set("__schemaVersion", 1)
            .set("/payload/thingId", TestConstants.Thing.THING_ID.toString())
            .set("/payload/thing", TestConstants.Thing.THING_V1.toJson(JsonSchemaVersion.V_1))
            .build();
    final Object object = toDbObject(eventJson);
    final Object actual = underTest.fromJournal(object, null).events().head();
    assertThat(actual).isInstanceOf(ThingEvent.class);
    final ThingEvent event = (ThingEvent) actual;
    assertThat((CharSequence) event.getThingEntityId()).isEqualTo(TestConstants.Thing.THING_ID);
    assertThat(event.getName()).isEqualTo(ThingCreated.NAME);
    assertThat(event.getType()).isEqualTo(ThingCreated.TYPE);
    assertThat(event).isInstanceOf(ThingCreated.class);
    final ThingCreated thingCreated = (ThingCreated) event;
    assertThat(thingCreated.getThing().toJsonString()).isEqualTo(TestConstants.Thing.THING_V1.toJsonString());
    assertThat((CharSequence) thingCreated.getThingEntityId()).isEqualTo(TestConstants.Thing.THING_ID);
}