@Test
    void testInvalidCommaInEnum() throws DefParser.DefParserException, IOException {
        assertThrows(DefParser.DefParserException.class, () -> {
            String invalidEnum = "anEnum enum {A, B, } default=A\n";
            String validEnum = "anotherEnum enum {A, B} default=A\n";
            StringBuilder sb = createDefTemplate();
            sb.append(invalidEnum);
            sb.append(validEnum);
            DefParser parser = createParser(sb.toString());
            parser.parse();
        });
    }
Unit tests for DefParser.

@author hmusum
@author gjoranv
configgen/src/test/java/com/yahoo/config/codegen/DefParserTest.java