@Test
public void testPlainJavascriptIncomingMapping() {

    final String correlationId = UUID.randomUUID().toString();
    final Map<String, String> headers = new HashMap<>();
    headers.put(HEADER_CORRELATION_ID, correlationId);
    headers.put(ExternalMessage.CONTENT_TYPE_HEADER, CONTENT_TYPE_PLAIN);
    final ExternalMessage message = ExternalMessageFactory.newExternalMessageBuilder(headers)
            .withText(MAPPING_INCOMING_PAYLOAD_STRING)
            .build();
    final long startTs = System.nanoTime();
    final List<Adaptable> adaptables = javaScriptRhinoMapperPlain.map(message);
    final Adaptable adaptable = adaptables.get(0);
    System.out.println(adaptable);
    System.out.println(
            "testPlainJavascriptIncomingMapping Duration: " + (System.nanoTime() - startTs) / 1000000.0 + "ms");
    assertThat(adaptable.getTopicPath().getChannel()).isEqualTo(TopicPath.Channel.TWIN);
    assertThat(adaptable.getTopicPath().getCriterion()).isEqualTo(TopicPath.Criterion.COMMANDS);
    assertThat(adaptable.getTopicPath().getAction()).contains(TopicPath.Action.MODIFY);
    assertThat(adaptable.getTopicPath().getNamespace()).isEqualTo(MAPPING_INCOMING_NAMESPACE);
    assertThat(adaptable.getTopicPath().getId()).isEqualTo(MAPPING_INCOMING_ID);
    assertThat(adaptable.getPayload().getPath().toString()).isEqualTo(MAPPING_INCOMING_PATH);
    assertThat(adaptable.getPayload().getValue()).contains(JsonValue.of(MAPPING_INCOMING_PAYLOAD_STRING));
}