@Test
public void resolvePolicyIdFromThingThrowsExceptionIfResponseIsNotExpected() {

    final ReferencePlaceholder referencePlaceholder =
            ReferencePlaceholder.fromCharSequence("{{ ref:things/" + THING_ID + "/policyId }}")
                    .orElseThrow(IllegalStateException::new);
    final CompletionStage<String> policyIdCS = sut.resolve(referencePlaceholder, DittoHeaders.empty());
    final RetrieveThing retrieveThing = conciergeForwarderActorProbe.expectMsgClass(RetrieveThing.class);
    assertThat((CharSequence) retrieveThing.getThingEntityId()).isEqualTo(THING_ID);
    assertThat(retrieveThing.getSelectedFields()).contains(JsonFieldSelector.newInstance("policyId"));
    conciergeForwarderActorProbe.reply("someThingUnexpected");
    Awaitility.await()
            .atMost(org.awaitility.Duration.ONE_SECOND)
            .until(() -> policyIdCS.toCompletableFuture().isDone());
    assertThat(policyIdCS.toCompletableFuture())
            .hasFailedWithThrowableThat()
            .isInstanceOf(GatewayInternalErrorException.class);
}