@Test
public void retrieveFeaturesWithFieldsFromAdaptable() {

    final JsonFieldSelector selectedFields = JsonFieldSelector.newInstance("foo");
    final RetrieveFeatures expected =
            RetrieveFeatures.of(TestConstants.THING_ID, selectedFields, TestConstants.DITTO_HEADERS_V_2);
    final TopicPath topicPath = topicPath(TopicPath.Action.RETRIEVE);
    final JsonPointer path = JsonPointer.of("/features");
    final Adaptable adaptable = Adaptable.newBuilder(topicPath)
            .withPayload(Payload.newBuilder(path).withFields(selectedFields).build())
            .withHeaders(TestConstants.HEADERS_V_2)
            .build();
    final ThingQueryCommand<?> actual = underTest.fromAdaptable(adaptable);
    assertWithExternalHeadersThat(actual).isEqualTo(expected);
}