public void shouldEnvelopeObjectWithoutCausation() throws JsonProcessingException {
enveloper.register(event);
when(envelope.metadata()).thenReturn(
metadataOf(COMMAND_UUID, TEST_EVENT_NAME)
.build());
<BUG>when(objectToJsonValueConverter.convert(object)).thenReturn(payload);
JsonEnvelope event = enveloper.withMetadataFrom(envelope).apply(object);</BUG>
assertThat(event.payloadAsJsonObject(), equalTo(payload));
assertThat(event.metadata().id(), notNullValue());
assertThat(event.metadata().name(), equalTo(TEST_EVENT_NAME));

public void shouldEnvelopeObjectWithoutCausation() throws JsonProcessingException {
enveloper.register(event);
when(envelope.metadata()).thenReturn(
metadataOf(COMMAND_UUID, TEST_EVENT_NAME)
.build());
when(objectToJsonValueConverter.convert(object)).thenReturn(payload);
when(clock.now()).thenReturn(ZonedDateTime.now());
JsonEnvelope event = enveloper.withMetadataFrom(envelope).apply(object);
assertThat(event.payloadAsJsonObject(), equalTo(payload));
assertThat(event.metadata().id(), notNullValue());
assertThat(event.metadata().name(), equalTo(TEST_EVENT_NAME));
