@Test
public void shouldEnvelopeMapNullObjectWithName() throws Exception {

    final JsonEnvelope event = enveloper.withMetadataFrom(
            envelopeFrom(
                    metadataBuilder()
                            .withId(COMMAND_UUID)
                            .withName(TEST_EVENT_NAME)
                            .withCausation(OLD_CAUSATION_ID),
                    createObjectBuilder()), TEST_NAME)
            .apply(null);
    assertThat(event.payload(), equalTo(JsonValue.NULL));
    assertThat(event.metadata().id(), notNullValue());
    assertThat(event.metadata().name(), equalTo(TEST_NAME));
    assertThat(event.metadata().causation().size(), equalTo(2));
    assertThat(event.metadata().causation().get(0), equalTo(OLD_CAUSATION_ID));
    assertThat(event.metadata().causation().get(1), equalTo(COMMAND_UUID));
}