@Test
public void merge_files() throws IOException {

	// Given
	URL url = Thread.currentThread().getContextClassLoader().getResource("example_merge");
	File example = new File(url.getPath());
	Path resources = temp.newFolder().toPath();
	FileUtils.copyDirectory(example, resources.toFile());
	ResourcesManager manager = new ResourcesManager(resources, null);
	List<CarnotzetModule> modules = Arrays.asList(
			CarnotzetModule.builder().name("service3").serviceId("service3").build(),
			CarnotzetModule.builder().name("service2").serviceId("service2").build(),
			CarnotzetModule.builder().name("service1").serviceId("service1").build()
	);
	// When
	manager.resolveResources(modules);
	// Then
	Properties service3config = new Properties();
	service3config.load(Files.newInputStream(resources.resolve("resolved/service3/files/config.properties")));
	assertThat(service3config.getProperty("overridden.from.service2"), is("service2value"));
	assertThat(service3config.getProperty("overridden.from.service1"), is("service1value"));
	assertThat(service3config.getProperty("added.from.service3"), is("service3value"));
	assertThat(service3config.getProperty("added.from.service2"), is("service2value"));
	assertThat(service3config.getProperty("added.from.service1"), is("service1value"));
	assertThat(service3config.getProperty("added.from.service2.and.overridden.from.service1"), is("service1value"));
	Properties service3carnotzet = new Properties();
	service3carnotzet.load(Files.newInputStream(resources.resolve("resolved/service3/carnotzet.properties")));
	assertThat(service3carnotzet.getProperty("docker.image"), is("service3"));
	assertThat(service3carnotzet.getProperty("network.aliases"), is("my-service3"));
	Properties service3carnotzet2 = new Properties();
	service3carnotzet2.load(Files.newInputStream(resources.resolve("resolved/service3/files/injected/from/service1/injected.properties")));
	assertThat(service3carnotzet2.getProperty("injected.from.service1"), is("service1value"));
}