@Test
public void createSubscriptionWithFieldsToAdaptable() {

    final TopicPath topicPath = TopicPath.fromNamespace(TopicPath.ID_PLACEHOLDER)
            .things()
            .twin()
            .search()
            .subscribe()
            .build();
    final JsonPointer path = JsonPointer.empty();
    final Adaptable expected = Adaptable.newBuilder(topicPath)
            .withPayload(Payload.newBuilder(path)
                    .withValue(JsonObject.of(String.format(
                            "{\"filter\": \"%s\", \"options\": \"%s\", \"namespaces\": %s}",
                            TestConstants.FILTER,
                            TestConstants.OPTIONS,
                            NAMESPACES_ARRAY
                    )))
                    .withFields(TestConstants.FIELDS)
                    .build())
            .withHeaders(TestConstants.DITTO_HEADERS_V_2_NO_STATUS)
            .build();
    final CreateSubscription createSubscription =
            CreateSubscription.of(TestConstants.FILTER, TestConstants.OPTIONS, TestConstants.FIELDS,
                    TestConstants.NAMESPACES, TestConstants.DITTO_HEADERS_V_2_NO_STATUS);
    final Adaptable actual = underTest.toAdaptable(createSubscription, TopicPath.Channel.TWIN);
    assertWithExternalHeadersThat(actual).isEqualTo(expected);
}