@Test
public void doForwardMappingContextWithDeviceIdPlaceholder() {

    final Map<String, String> headers = createValidHeaders();
    underTest.configure(mappingConfig, createMapperConfig(THING_TEMPLATE, COMMAND_HEADERS));
    final ExternalMessage externalMessage = ExternalMessageFactory.newExternalMessageBuilder(headers).build();
    final List<Adaptable> mappingResult = underTest.map(externalMessage);
    final Signal<?> firstMappedSignal = getFirstMappedSignal(mappingResult);
    assertThat(firstMappedSignal).isInstanceOf(CreateThing.class);
    final CreateThing createThing = (CreateThing) firstMappedSignal;
    final Thing expectedThing = createExpectedThing(DEVICE_ID, DEVICE_ID, GATEWAY_ID);
    assertThat(createThing.getThing().getEntityId()).isEqualTo(expectedThing.getEntityId());
    assertThat(createThing.getThing().getPolicyEntityId()).isEmpty();
    assertThat(createThing.getThing().getAttributes()).isEqualTo(expectedThing.getAttributes());
    assertThat(createThing.getDittoHeaders().getContentType()).contains(DITTO_PROTOCOL_CONTENT_TYPE);
    assertThat(createThing.getPolicyIdOrPlaceholder()).contains(GATEWAY_ID);
    assertThat(createThing.getDittoHeaders().isAllowPolicyLockout()).isEqualTo(true);
}