@Test
public void deserializeAttributesCreatedV1() {

    final JsonObject eventJson = JsonFactory.newObjectBuilder()
            .set("event", "thingAttributesModified")
            .set("__schemaVersion", 1)
            .set("payload", JsonFactory.newObjectBuilder()
                    .set("thingId", TestConstants.Thing.THING_ID.toString())
                    .set("attributes", TestConstants.Thing.ATTRIBUTES.toJson(JsonSchemaVersion.V_1))
                    .set("created", true)
                    .build())
            .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(AttributesCreated.NAME);
    assertThat(event.getType()).isEqualTo(AttributesCreated.TYPE);
    assertThat(event).isInstanceOf(AttributesCreated.class);
    final AttributesCreated attributesCreated = (AttributesCreated) event;
    assertThat((CharSequence) attributesCreated.getThingEntityId()).isEqualTo(TestConstants.Thing.THING_ID);
    assertThat(attributesCreated.getCreatedAttributes().toJsonString())
            .isEqualTo(TestConstants.Thing.ATTRIBUTES.toJsonString());
}