@Test
public void testConfigurationYAML() {

	File tmpDir = tempFolder.getRoot();
	File confFile = new File(tmpDir, GlobalConfiguration.FLINK_CONF_FILENAME);
	try {
		try (final PrintWriter pw = new PrintWriter(confFile)) {
			pw.println("###########################"); // should be skipped
			pw.println("# Some : comments : to skip"); // should be skipped
			pw.println("###########################"); // should be skipped
			pw.println("mykey1: myvalue1"); // OK, simple correct case
			pw.println("mykey2       : myvalue2"); // OK, whitespace before colon is correct
			pw.println("mykey3:myvalue3"); // SKIP, missing white space after colon
			pw.println(" some nonsense without colon and whitespace separator"); // SKIP
			pw.println(" :  "); // SKIP
			pw.println("   "); // SKIP (silently)
			pw.println(" "); // SKIP (silently)
			pw.println("mykey4: myvalue4# some comments"); // OK, skip comments only
			pw.println("   mykey5    :    myvalue5    "); // OK, trim unnecessary whitespace
			pw.println("mykey6: my: value6"); // OK, only use first ': ' as separator
			pw.println("mykey7: "); // SKIP, no value provided
			pw.println(": myvalue8"); // SKIP, no key provided
			pw.println("mykey9: myvalue9"); // OK
			pw.println("mykey9: myvalue10"); // OK, overwrite last value
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
		Configuration conf = GlobalConfiguration.loadConfiguration(tmpDir.getAbsolutePath());
		// all distinct keys from confFile1 + confFile2 key
		assertEquals(6, conf.keySet().size());
		// keys 1, 2, 4, 5, 6, 7, 8 should be OK and match the expected values
		assertEquals("myvalue1", conf.getString("mykey1", null));
		assertEquals("myvalue2", conf.getString("mykey2", null));
		assertEquals("null", conf.getString("mykey3", "null"));
		assertEquals("myvalue4", conf.getString("mykey4", null));
		assertEquals("myvalue5", conf.getString("mykey5", null));
		assertEquals("my: value6", conf.getString("mykey6", null));
		assertEquals("null", conf.getString("mykey7", "null"));
		assertEquals("null", conf.getString("mykey8", "null"));
		assertEquals("myvalue10", conf.getString("mykey9", null));
	} finally {
		confFile.delete();
		tmpDir.delete();
	}
}