@Test
public void testIndexValueTooLarge() {

    assertThrows(FDBExceptions.FDBStoreValueSizeException.class, () -> {
        try (FDBRecordContext context = openContext()) {
            openSimpleRecordStore(context, md -> {
                md.setSplitLongRecords(true);
                md.removeIndex("MySimpleRecord$str_value_indexed");
                md.addIndex("MySimpleRecord", new Index(
                        "valueIndex",
                        field("num_value_2"),
                        field("str_value_indexed"),
                        IndexTypes.VALUE,
                        Collections.emptyMap()));
            });
            TestRecords1Proto.MySimpleRecord.Builder recBuilder = TestRecords1Proto.MySimpleRecord.newBuilder();
            recBuilder.setRecNo(1);
            recBuilder.setStrValueIndexed(Strings.repeat("x", 100000));
            recordStore.saveRecord(recBuilder.build());
            fail("exception should have been thrown before commit");
            commit(context);
        }
    });
}