ConfigurationJsonMerger extends AbstractJsonConfigurationHandler { public Map<String, Serializable> merge() { return SerializationUtils.clone(merge(platform, tenant)); } ConfigurationJsonMerger(final Map<String, Serializable> platform, final Map<String, Serializable> tenant); Map<String, Serializable> merge();  }
@Test public void testConfigurationMerge() throws Exception { Map<String, Serializable> generalConfiguration = getConfiguration(defaultConfiguration); Map<String, Serializable> tenantConfiguration = loadConfiguration("configuration/tenant1.json"); ConfigurationJsonMerger merger = new ConfigurationJsonMerger(generalConfiguration, tenantConfiguration); Map<String, Serializable> merged = merger.merge(); Assert.assertEquals(Locale.FRANCE.toString(), ((Map<String, Object>) ((Map<String, Object>) merged.get("locales")).get("main")).get("value") ); }
@Test public void testConfigurationMergeWhenPropertyIsNotConfigurable() throws Exception { Map<String, Serializable> generalConfiguration = getConfiguration(localesNotConfigurableConfiguration); Map<String, Serializable> tenantConfiguration = loadConfiguration("configuration/tenant1.json"); ConfigurationJsonMerger merger = new ConfigurationJsonMerger(generalConfiguration, tenantConfiguration); Map<String, Serializable> merged = merger.merge(); Assert.assertEquals(Locale.ENGLISH.toString(), ((Map<String, Object>) ((Map<String, Object>) merged.get("locales")).get("main")).get("value") ); }