@Test
public void testNoopJavascriptOutgoingMapping() {

    final ThingId thingId = ThingId.of("org.eclipse.ditto:foo-bar-plain");
    final String correlationId = UUID.randomUUID().toString();
    final Thing newThing = Thing.newBuilder()
            .setId(thingId)
            .setAttributes(Attributes.newBuilder().set("foo", "bar").build())
            .build();
    final CreateThing createThing =
            CreateThing.of(newThing, null,
                    DittoHeaders.newBuilder().correlationId(correlationId).putHeader("subject",
                            "{{topic:action-subject}}").build());
    final Adaptable inputAdaptable = DittoProtocolAdapter.newInstance().toAdaptable(createThing);
    final JsonifiableAdaptable jsonifiableInputAdaptable =
            ProtocolFactory.wrapAsJsonifiableAdaptable(inputAdaptable);
    final long startTs = System.nanoTime();
    final List<ExternalMessage> rawMessageOpt = javaScriptRhinoMapperNoop.map(inputAdaptable);
    final ExternalMessage rawMessage = rawMessageOpt.get(0);
    System.out.println(rawMessage.getHeaders());
    System.out.println(rawMessage);
    System.out.println(
            "testNoopJavascriptOutgoingMapping Duration: " + (System.nanoTime() - startTs) / 1000000.0 + "ms");
    assertThat(rawMessage.findContentType()).contains(DittoConstants.DITTO_PROTOCOL_CONTENT_TYPE);
    assertThat(rawMessage.findHeader(HEADER_CORRELATION_ID)).contains(correlationId);
    assertThat(rawMessage.isTextMessage()).isTrue();
    final String textPayload = rawMessage.getTextPayload().get();
    DittoJsonAssertions.assertThat(JsonFactory.readFrom(textPayload).asObject())
            .isEqualToIgnoringFieldDefinitions(jsonifiableInputAdaptable.toJson());
}