@Test
public void tryToCreateInstanceWithJsonObjectContainingInvalidHeader() {

    final String schemaVersionKey = DittoHeaderDefinition.SCHEMA_VERSION.getKey();
    final String invalidSchemaVersionValue = "meh";
    final JsonObject headersJsonObject = JsonFactory.newObjectBuilder()
            .set(DittoHeaderDefinition.RESPONSE_REQUIRED.getKey(), false)
            .set(schemaVersionKey, invalidSchemaVersionValue)
            .set("foo", "bar")
            .build();
    assertThatExceptionOfType(DittoHeaderInvalidException.class)
            .isThrownBy(() -> of(headersJsonObject))
            .withMessage("The value '%s' of the header '%s' is not a valid int.", invalidSchemaVersionValue,
                    schemaVersionKey)
            .withNoCause();
}