@Test
public void testBuilderFromEnvironment() throws Exception {

	Configuration conf = new Configuration();
	File binFolder = tempFolder.newFolder("bin");
	File libFolder = tempFolder.newFolder("lib");
	File confFolder = tempFolder.newFolder("conf");
	// adjust the test environment for the purposes of this test
	Map<String, String> map = new HashMap<String, String>(System.getenv());
	map.put(ENV_FLINK_BIN_DIR, binFolder.getAbsolutePath());
	map.put(ENV_FLINK_LIB_DIR, libFolder.getAbsolutePath());
	map.put(ENV_FLINK_CONF_DIR, confFolder.getAbsolutePath());
		CommonTestUtils.setEnv(map);
	FlinkDistributionOverlay.Builder builder = FlinkDistributionOverlay.newBuilder().fromEnvironment(conf);
	assertEquals(binFolder.getAbsolutePath(), builder.flinkBinPath.getAbsolutePath());
	assertEquals(libFolder.getAbsolutePath(), builder.flinkLibPath.getAbsolutePath());
	assertEquals(confFolder.getAbsolutePath(), builder.flinkConfPath.getAbsolutePath());
}