@Test
public void giveUpIfKeyIsTooLong() {

    final String value = "value";
    final String baseKey = "/attributes/giveUpIfKeyIsTooLong/";
    final int maxAllowed =
            MAX_INDEX_CONTENT_LENGTH - OVERHEAD - baseKey.length();
    final String key = baseKey + TestStringGenerator.createStringOfBytes(maxAllowed + 1);
    assertThat(indexLengthRestrictionEnforcer.enforce(JsonPointer.of(key), JsonValue.of(value)))
            .isEmpty();
}