public File[] getFiles(File configRepoCheckoutDirectory, PartialConfigLoadContext context) {
        String pattern = defaultPattern;

        Configuration configuration = context.configuration();
        if (configuration != null) {
            ConfigurationProperty explicitPattern = configuration.getProperty("pattern");
            if (explicitPattern != null) {
                pattern = explicitPattern.getValue();
            }
        }

        return getFiles(configRepoCheckoutDirectory, pattern);
    }
@Test
    public void shouldUseExplicitPatternWhenProvided() throws Exception {
        GoConfigMother mother = new GoConfigMother();
        PipelineConfig pipe1 = mother.cruiseConfigWithOnePipelineGroup().getAllPipelineConfigs().get(0);

        File file1 = helper.addFileWithPipeline("pipe1.myextension", pipe1);
        File file2 = helper.addFileWithPipeline("pipe1.gcd.xml", pipe1);
        File file3 = helper.addFileWithPipeline("subdir/pipe1.gocd.xml", pipe1);
        File file4 = helper.addFileWithPipeline("subdir/sub/pipe1.gocd.xml", pipe1);

        PartialConfigLoadContext context = mock(PartialConfigLoadContext.class);
        Configuration configs = new Configuration();
        configs.addNewConfigurationWithValue("pattern","*.myextension",false);
        when(context.configuration()).thenReturn(configs);

        File[] matchingFiles = xmlPartialProvider.getFiles(tmpFolder, context);

        File[] expected = new File[1];
        expected[0] = file1;
        assertArrayEquals(expected,matchingFiles);
    }