DefaultJsonEnvelopeProvider implements JsonEnvelopeProvider { @Override public JsonEnvelope envelopeFrom(final Metadata metadata, final JsonValue payload) { return new DefaultJsonEnvelope(metadata, payload); }  @Override JsonEnvelope envelopeFrom(final Metadata metadata, final JsonValue payload); @Override JsonEnvelope envelopeFrom(final MetadataBuilder metadataBuilder, final JsonValue payload); @Override JsonEnvelope envelopeFrom(final MetadataBuilder metadataBuilder, final JsonObjectBuilder payloadBuilder); @Override MetadataBuilder metadataBuilder(); @Override MetadataBuilder metadataFrom(final Metadata metadata); @Override MetadataBuilder metadataFrom(final JsonObject jsonObject);  }
@Test public void shouldProvideDefaultJsonEnvelopeFromMetadataAndJsonValue() throws Exception { final Metadata metadata = mock(Metadata.class); final JsonValue payload = mock(JsonValue.class); final JsonEnvelope envelope = new DefaultJsonEnvelopeProvider().envelopeFrom(metadata, payload); assertThat(envelope, instanceOf(DefaultJsonEnvelope.class)); assertThat(envelope.metadata(), is(metadata)); assertThat(envelope.payload(), is(payload)); }