@Test
public void testTargetAddressPlaceholderReplacement() throws JMSException {

    final Connection connection =
            TestConstants.createConnection(CONNECTION_ID,
                    TestConstants.Targets.TARGET_WITH_PLACEHOLDER);
    // target Placeholder: target:{{ thing:namespace }}/{{thing:name}}@{{ topic:channel }}
    final String expectedAddress =
            "target:" + TestConstants.Things.NAMESPACE + "/" + TestConstants.Things.ID + "@" +
                    TopicPath.Channel.TWIN.getName();
    new TestKit(actorSystem) {{
        final Props props =
                AmqpClientActor.propsForTests(connection, getRef(), getRef(),
                        (ac, el) -> mockConnection);
        final ActorRef amqpClientActor = actorSystem.actorOf(props);
        amqpClientActor.tell(OpenConnection.of(CONNECTION_ID, DittoHeaders.empty()), getRef());
        expectMsg(CONNECTED_SUCCESS);
        final ThingModifiedEvent thingModifiedEvent = TestConstants.thingModified(Collections.emptyList());
        final OutboundSignal outboundSignal = OutboundSignalFactory.newOutboundSignal(thingModifiedEvent,
                singletonList(ConnectivityModelFactory.newTargetBuilder()
                        .address(TestConstants.Targets.TARGET_WITH_PLACEHOLDER.getAddress())
                        .authorizationContext(Authorization.AUTHORIZATION_CONTEXT)
                        .topics(Topic.TWIN_EVENTS)
                        .build()));
        amqpClientActor.tell(outboundSignal, getRef());
        final ArgumentCaptor<JmsMessage> messageCaptor = ArgumentCaptor.forClass(JmsMessage.class);
        final MessageProducer messageProducer = getProducerForAddress(expectedAddress);
        verify(messageProducer, timeout(2000)).send(messageCaptor.capture(), any(CompletionListener.class));
        final Message message = messageCaptor.getValue();
        assertThat(message).isNotNull();
    }};
}