public GoConfigHolder loadConfigHolder(final String content, Callback callback) throws Exception {
        CruiseConfig configForEdit;
        CruiseConfig config;
        LOGGER.debug("[Config Save] Loading config holder");
        configForEdit = deserializeConfig(content);
        if (callback != null) callback.call(configForEdit);
        config = preprocessAndValidate(configForEdit);

        return new GoConfigHolder(config, configForEdit);
    }
@Test
    void shouldNotAllowMoreThanOneOnCancelTaskWhenDefined() {
        String xml = ("""
                <cruise schemaVersion='%d'>
                <server>
                    <artifacts>
                      <artifactsDir>artifactsDir</artifactsDir>
                    </artifacts>
                </server>
                <pipelines>
                <pipeline name='pipeline1' template='abc'>
                    <materials>
                      <svn url ='svnurl' username='foo' password='password'/>
                    </materials>
                </pipeline>
                </pipelines>
                <templates>
                  <pipeline name='abc'>
                    <stage name='stage1'>
                      <jobs>
                        <job name='job1'>
                         <tasks>
                             <exec command="rake">
                                 <arg>all_test</arg>
                                 <oncancel>
                                     <ant target='kill' />
                                     <ant target='kill' />
                                 </oncancel>
                             </exec>
                         </tasks>
                        </job>
                      </jobs>
                    </stage>
                  </pipeline>
                </templates>
                </cruise>""").formatted(CONFIG_SCHEMA_VERSION);

        assertThatThrownBy(() -> xmlLoader.loadConfigHolder(xml))
                .hasMessage("Invalid content was found starting with element 'ant'. No child element is expected at this point.");
    }