@Test
    void duplicate_parameter_is_illegal() {
        Class<?> exceptionClass = DefParser.DefParserException.class;
        StringBuilder sb = createDefTemplate();
        String duplicateLine = "b int\n";
        sb.append(duplicateLine);
        sb.append(duplicateLine);
        try {
            createParser(sb.toString()).parse();
            fail("Didn't find expected exception of type " + exceptionClass);
        } catch (Exception e) {
            assertExceptionAndMessage(e, exceptionClass,
                    "Error when parsing line 3: " + duplicateLine + "b is already defined");
        }
    }
Unit tests for DefParser.

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