@Test
public void testReplacementOfPlaceholders() {

    final String correlationId = UUID.randomUUID().toString();
    final AuthorizationContext contextWithPlaceholders =
            AuthorizationModelFactory.newAuthContext(DittoAuthorizationContextType.UNSPECIFIED,
                    AuthorizationModelFactory.newAuthSubject(
                            "integration:{{header:correlation-id}}:hub-{{   header:content-type   }}"),
                    AuthorizationModelFactory.newAuthSubject(
                            "integration:{{header:content-type}}:hub-{{ header:correlation-id }}"));
    final AuthorizationContext expectedAuthContext = TestConstants.Authorization.withUnprefixedSubjects(
            AuthorizationModelFactory.newAuthContext(
                    DittoAuthorizationContextType.UNSPECIFIED,
                    AuthorizationModelFactory.newAuthSubject(
                            "integration:" + correlationId + ":hub-application/json"),
                    AuthorizationModelFactory.newAuthSubject("integration:application/json:hub-" + correlationId)));
    testMessageMapping(correlationId, contextWithPlaceholders, ModifyAttribute.class, modifyAttribute -> {
        assertThat(modifyAttribute.getType()).isEqualTo(ModifyAttribute.TYPE);
        assertThat(modifyAttribute.getDittoHeaders().getCorrelationId()).contains(correlationId);
        assertThat(modifyAttribute.getDittoHeaders().getAuthorizationContext().getAuthorizationSubjects())
                .isEqualTo(expectedAuthContext.getAuthorizationSubjects());
        // mapped by source <- {{ request:subjectId }}
        assertThat(modifyAttribute.getDittoHeaders().get("source"))
                .contains("integration:" + correlationId + ":hub-application/json");
    });
}