@Test
public void tryToCreateInstanceWithMapContainingInvalidHeader() {

    final String readSubjectsKey = DittoHeaderDefinition.READ_SUBJECTS.getKey();
    final String invalidJsonArrayString = "['Frank',42,'Grimes']";
    final Map<String, String> initialHeaders = new HashMap<>();
    initialHeaders.put(DittoHeaderDefinition.DRY_RUN.getKey(), "true");
    initialHeaders.put("foo", "bar");
    initialHeaders.put(readSubjectsKey, invalidJsonArrayString);
    assertThatExceptionOfType(DittoHeaderInvalidException.class)
            .isThrownBy(() -> of(initialHeaders))
            .withMessage("The value '%s' of the header '%s' is not a valid JSON array.", invalidJsonArrayString,
                    readSubjectsKey)
            .withNoCause();
}