@Test
public void requestSubscriptionFromAdaptable() {

    final RequestFromSubscription expected =
            RequestFromSubscription.of(TestConstants.SUBSCRIPTION_ID, TestConstants.DEMAND,
                    TestConstants.DITTO_HEADERS_V_2_NO_STATUS);
    final TopicPath topicPath = TopicPath.fromNamespace(String.join(",", TestConstants.NAMESPACES))
            .things()
            .twin()
            .search()
            .request()
            .build();
    final JsonPointer path = JsonPointer.empty();
    final Adaptable adaptable = Adaptable.newBuilder(topicPath)
            .withPayload(Payload.newBuilder(path)
                    .withValue(JsonObject.of(String.format(
                            "{\"subscriptionId\": \"%s\", \"demand\": %s}", TestConstants.SUBSCRIPTION_ID,
                            TestConstants.DEMAND)))
                    .build())
            .withHeaders(TestConstants.DITTO_HEADERS_V_2_NO_STATUS)
            .build();
    final ThingSearchCommand actual = underTest.fromAdaptable(adaptable);
    assertWithExternalHeadersThat(actual).isEqualTo(expected);
}