@Test
public void optionallyTruncateLongProperties() {

    StringWriter sw = new StringWriter();
    try (SDFWriter sdfw = new SDFWriter(sw)) {
        sdfw.getSetting(MDLV2000Writer.OptWriteDefaultProperties)
            .setSetting("false");
        sdfw.getSetting(SDFWriter.OptTruncateLongData)
            .setSetting("true");
        IAtomContainer mol = TestMoleculeFactory.make123Triazole();
        mol.setProperty("MyLongField",
                        "ThisIsAVeryLongFieldThatShouldBeWrapped" +
                        "ThisIsAVeryLongFieldThatShouldBeWrapped" +
                        "ThisIsAVeryLongFieldThatShouldBeWrapped" +
                        "ThisIsAVeryLongFieldThatShouldBeWrapped" +
                        "ThisIsAVeryLongFieldThatShouldBeWrapped" +
                        "ThisIsAVeryLongFieldThatShouldBeWrapped" +
                        "ThisIsAVeryLongFieldThatShouldBeWrapped" +
                        "ThisIsAVeryLongFieldThatShouldBeWrapped" +
                        "ThisIsAVeryLongFieldThatShouldBeWrapped" +
                        "ThisIsAVeryLongFieldThatShouldBeWrapped");
        sdfw.write(mol);
    } catch (IOException | CDKException e) {
        e.printStackTrace();
    }
    String sdf = sw.toString();
    assertThat(sdf,
               CoreMatchers.containsString("ThisIsAVeryLongFieldThatShouldBeWrappedThisIsAVeryLongFieldThatShouldBeWrappedThisIsAVeryLongFieldThatShouldBeWrappedThisIsAVeryLongFieldThatShouldBeWrappedThisIsAVeryLongFieldThatShouldBeWrappedThisI\n"));
}