public static ConfigDefinitionKey parseConfigName(Element configE) {
        if (!configE.getNodeName().equals("config")) {
            throw new IllegalArgumentException("The root element must be 'config', but was '" + configE.getNodeName() + "'");
        }

        if (!configE.hasAttribute("name")) {
            throw new IllegalArgumentException
                    ("The 'config' element must have a 'name' attribute that matches the name of the config definition");
        }

        String elementString = configE.getAttribute("name");
        if (!elementString.contains(".")) {
            throw new IllegalArgumentException("The config name '" + elementString +
                                               "' contains illegal characters. Only names with the pattern " +
                                               namespacePattern.pattern() + "." + namePattern.pattern() + " are legal.");
        }

        Tuple2<String, String> t = ConfigUtils.getNameAndNamespaceFromString(elementString);
        String xmlName = t.first;
        String xmlNamespace = t.second;

        if (!validName(xmlName)) {
            throw new IllegalArgumentException("The config name '" + xmlName +
                                               "' contains illegal characters. Only names with the pattern " +
                                               namePattern.toString() + " are legal.");
        }

        if (!validNamespace(xmlNamespace)) {
            throw new IllegalArgumentException("The config namespace '" + xmlNamespace +
                                               "' contains illegal characters. Only namespaces with the pattern " +
                                               namespacePattern.toString() + " are legal.");
        }
        return new ConfigDefinitionKey(xmlName, xmlNamespace);
    }
@Test
    void testNameParsing() {
        Element configRoot = getDocument(new StringReader("<config name=\"test.function-test\" version=\"1\">" +
                "<int_val>1</int_val> +" +
                "</config>"));
        ConfigDefinitionKey key = DomConfigPayloadBuilder.parseConfigName(configRoot);
        assertEquals("function-test", key.getName());
        assertEquals("test", key.getNamespace());
    }