@Override
    public PartialConfig load(File configRepoCheckoutDirectory, PartialConfigLoadContext context) {
        File[] allFiles = getFiles(configRepoCheckoutDirectory, context);

        // if context had changed files list then we could parse only new content

        PartialConfig[] allFragments = parseFiles(allFiles);

        PartialConfig partialConfig = new PartialConfig();

        collectFragments(allFragments, partialConfig);

        return partialConfig;
    }
@Test
    public void shouldLoadDirectoryWithTwoPipelineGroupsAndEnvironment() throws Exception {
        GoConfigMother mother = new GoConfigMother();
        PipelineGroups groups = mother.cruiseConfigWithTwoPipelineGroups().getGroups();
        EnvironmentConfig env = EnvironmentConfigMother.environment("dev");

        helper.addFileWithPipelineGroup("group1.gocd.xml", groups.get(0));
        helper.addFileWithPipelineGroup("group2.gocd.xml", groups.get(1));
        helper.addFileWithEnvironment("dev-env.gocd.xml", env);

        PartialConfig part = xmlPartialProvider.load(tmpFolder, mock(PartialConfigLoadContext.class));

        PipelineGroups groupsRead = part.getGroups();
        assertThat(groupsRead.size(),is(2));

        EnvironmentsConfig loadedEnvs = part.getEnvironments();
        assertThat(loadedEnvs.size(),is(1));
        assertThat(loadedEnvs.get(0),is(env));
    }