@Test
public void testValidateFails() {

    // unsupported placeholder in parameter position
    assertThatExceptionOfType(UnresolvedPlaceholderException.class).isThrownBy(
            () -> PlaceholderFilter.validate("{{  header:xxx | fn:default(ing:namespace) }}",
                    placeholders));
    // illegal braces combinations
    assertThatExceptionOfType(UnresolvedPlaceholderException.class).isThrownBy(
            () -> PlaceholderFilter.validate("{{th{{ing:namespace }}{{  thing:name }}{{header:device-id }}",
                    placeholders));
    assertThatExceptionOfType(UnresolvedPlaceholderException.class).isThrownBy(
            () -> PlaceholderFilter.validate("{{th}}ing:namespace }}{{  thing:name }}{{header:device-id }}",
                    placeholders));
    assertThatExceptionOfType(UnresolvedPlaceholderException.class).isThrownBy(
            () -> PlaceholderFilter.validate("{{thing:nam{{espace }}{{  thing:name }}{{header:device-id }}",
                    placeholders));
    assertThatExceptionOfType(UnresolvedPlaceholderException.class).isThrownBy(
            () -> PlaceholderFilter.validate("{{thing:nam}}espace }}{{  thing:name }}{{header:device-id }}",
                    placeholders));
    assertThatExceptionOfType(PlaceholderFunctionTooComplexException.class).isThrownBy(
            () -> PlaceholderFilter.validate(
                    "{{ header:unknown | fn:default('fallback') | fn:upper() | fn:lower() | fn:upper() | fn:lower() | fn:upper() | fn:lower() | fn:upper() | fn:lower() | fn:upper() | fn:lower() }}",
                    placeholders));
}