@Test
public void cancelSubscriptionToAdaptable() {

    final TopicPath topicPath = TopicPath.fromNamespace("_")
            .things()
            .twin()
            .search()
            .cancel()
            .build();
    final JsonPointer path = JsonPointer.empty();
    final Adaptable expected = Adaptable.newBuilder(topicPath)
            .withPayload(Payload.newBuilder(path)
                    .withValue(JsonObject.of(String.format(
                            "{\"subscriptionId\": \"%s\"}", TestConstants.SUBSCRIPTION_ID)))
                    .build())
            .withHeaders(TestConstants.DITTO_HEADERS_V_2_NO_STATUS)
            .build();
    final CancelSubscription cancelSubscription =
            CancelSubscription.of(TestConstants.SUBSCRIPTION_ID, TestConstants.DITTO_HEADERS_V_2_NO_STATUS);
    final Adaptable actual = underTest.toAdaptable(cancelSubscription, TopicPath.Channel.TWIN);
    assertWithExternalHeadersThat(actual).isEqualTo(expected);
}