DigesterDefinitionsReader implements DefinitionsReader { public void addDefinition(Definition definition) { String name = definition.getName(); if (name == null) { throw new DigesterDefinitionsReaderException( "A root definition has been defined with no name"); } definitions.put(name, definition); } DigesterDefinitionsReader(); void setValidating(boolean validating); Map<String, Definition> read(Object source); void addDefinition(Definition definition); static final String PARSER_VALIDATE_PARAMETER_NAME; }
@Test(expected = DigesterDefinitionsReaderException.class) public void testAddDefinitionNoName() { Definition def = new Definition(); reader.addDefinition(def); }