@Test
public void testTopicPlaceholder() {

    assertThatExceptionOfType(NullPointerException.class).isThrownBy(
            () -> topicPlaceholder.resolve(KNOWN_TOPIC_PATH, null));
    assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(
            () -> topicPlaceholder.resolve(KNOWN_TOPIC_PATH, ""));
    assertThatExceptionOfType(UnresolvedPlaceholderException.class).isThrownBy(
            () -> PlaceholderFilter.apply("{{ topic:unknown }}", KNOWN_TOPIC_PATH, topicPlaceholder));
    assertThatExceptionOfType(UnresolvedPlaceholderException.class).isThrownBy(
            () -> PlaceholderFilter.apply("{{ {{  topic:name  }} }}", KNOWN_TOPIC_PATH, topicPlaceholder));
    assertThat(PlaceholderFilter.apply("eclipse:ditto", KNOWN_TOPIC_PATH, topicPlaceholder)).isEqualTo(
            "eclipse:ditto");
    assertThat(PlaceholderFilter.apply("prefix:{{ topic:channel }}:{{ topic:group }}:suffix", KNOWN_TOPIC_PATH,
            topicPlaceholder)).isEqualTo("prefix:twin:things:suffix");
    assertThat(PlaceholderFilter.apply("{{topic:subject}}", KNOWN_TOPIC_PATH_SUBJECT1,
            topicPlaceholder)).isEqualTo(KNOWN_SUBJECT);
    assertThat(PlaceholderFilter.apply("{{  topic:action-subject}}", KNOWN_TOPIC_PATH_SUBJECT2,
            topicPlaceholder)).isEqualTo(KNOWN_SUBJECT2);
}