@Test
public void testPlainJavascriptIncomingMappingWithStatusAndExtra() {

    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 ThingId thingId = ThingId.of("org.eclipse.ditto:foo-bar-plain");
    final ModifyThingResponse modifyThingResponse = ModifyThingResponse.modified(thingId, DittoHeaders.newBuilder()
            .correlationId(correlationId)
            .putHeader("subject", "{{topic:action-subject}}")
            .build());
    final ExternalMessage message = ExternalMessageFactory.newExternalMessageBuilder(headers)
            .withText(modifyThingResponse.toJsonString())
            .build();
    final long startTs = System.nanoTime();
    final List<Adaptable> adaptables = javaScriptRhinoMapperPlainWithStatusAndExtra.map(message);
    final Adaptable adaptable = adaptables.get(0);
    System.out.println(adaptable);
    System.out.println(
            "testPlainJavascriptIncomingMapping Duration: " + (System.nanoTime() - startTs) / 1000000.0 + "ms");
    try (final AutoCloseableSoftAssertions softly = new AutoCloseableSoftAssertions()) {
        softly.assertThat(adaptable.getTopicPath()).satisfies(topicPath -> {
            softly.assertThat(topicPath.getChannel()).isEqualTo(TopicPath.Channel.TWIN);
            softly.assertThat(topicPath.getCriterion()).isEqualTo(TopicPath.Criterion.COMMANDS);
            softly.assertThat(topicPath.getAction()).contains(TopicPath.Action.MODIFY);
            softly.assertThat(topicPath.getNamespace()).isEqualTo(MAPPING_INCOMING_NAMESPACE);
            softly.assertThat(topicPath.getId()).isEqualTo(MAPPING_INCOMING_ID);
        });
        softly.assertThat(adaptable.getPayload()).satisfies(payload -> {
            softly.assertThat(payload.getPath().toString()).isEqualTo(MAPPING_INCOMING_PATH);
            softly.assertThat(payload.getValue()).map(JsonValue::asString)
                    .contains(modifyThingResponse.toJsonString());
            softly.assertThat(payload.getStatus()).contains(HttpStatusCode.NO_CONTENT);
            softly.assertThat(payload.getExtra()).contains(JsonObject.newBuilder()
                    .set("attributes", JsonObject.newBuilder().set("enriched", "field").build())
                    .build());
        });
    }
}