@Override
    public Map<String, Object> load(String configKey) {
        if (targetFilePath != null) {
            try {
                Map<String, Object> raw = (Map<String, Object>) Utils.readYamlFile(targetFilePath);
                if (raw != null) {
                    return (Map<String, Object>) raw.get(configKey);
                }
            } catch (Exception e) {
                LOG.error("Failed to load from file {}", targetFilePath);
            }
        }
        return null;
    }
@Test
    public void testValidFile() throws Exception {

        File temp = Files.createTempFile("FileLoader", ".yaml").toFile();
        temp.deleteOnExit();

        Map<String, Integer> testMap = new HashMap<>();
        testMap.put("a", 1);
        testMap.put("b", 2);
        testMap.put("c", 3);
        testMap.put("d", 4);
        testMap.put("e", 5);

        Map<String, Map<String, Integer>> confMap = new HashMap<>();
        confMap.put(DaemonConfig.MULTITENANT_SCHEDULER_USER_POOLS, testMap);

        Yaml yaml = new Yaml();
        FileWriter fw = new FileWriter(temp);
        yaml.dump(confMap, fw);
        fw.flush();
        fw.close();

        Config conf = new Config();
        conf.put(DaemonConfig.SCHEDULER_CONFIG_LOADER_URI, FILE_SCHEME_PREFIX + temp.getCanonicalPath());
        FileConfigLoader loader = new FileConfigLoader(conf);

        Map<String, Object> result = loader.load(DaemonConfig.MULTITENANT_SCHEDULER_USER_POOLS);

        assertNotNull(result, "Unexpectedly returned null");

        assertEquals(testMap.keySet().size(), result.keySet().size(), "Maps are a different size");

        for (String key : testMap.keySet()) {
            Integer expectedValue = testMap.get(key);
            Integer returnedValue = (Integer) result.get(key);
            assertEquals(expectedValue, returnedValue, "Bad value for key=" + key);
        }
    }