### Question:
MonitorizedPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer { @Override protected Properties mergeProperties() throws IOException { Properties result = super.mergeProperties(); if(canShowConfiguration(getModuleName())) { table.setProperties(result); table.dump(System.out); } return result; } MonitorizedPropertyPlaceholderConfigurer(); void setModuleName(String moduleName); String getModuleName(); @Override void setLocation(Resource location); @Override void setLocations(Resource[] locations); static final String LDP4J_CONFIG_DUMP; static final String LDP4J_CONFIG_MODULES; }### Answer:
@Test public void testMergeProperties$dontShow() throws Exception{ MonitorizedPropertyPlaceholderConfigurer sut=new MonitorizedPropertyPlaceholderConfigurer(); sut.setIgnoreResourceNotFound(true); sut.setLocations(this.locations); Properties mergeProperties = sut.mergeProperties(); assertThat(mergeProperties.size(),is(4)); }
@Test public void testMergeProperties$show() throws Exception{ MonitorizedPropertyPlaceholderConfigurer sut=new MonitorizedPropertyPlaceholderConfigurer(); sut.setModuleName("module"); sut.setIgnoreResourceNotFound(true); sut.setLocations(this.locations); System.setProperty(MonitorizedPropertyPlaceholderConfigurer.LDP4J_CONFIG_DUMP, Boolean.TRUE.toString()); System.setProperty(MonitorizedPropertyPlaceholderConfigurer.LDP4J_CONFIG_MODULES, "modules, module"); Properties mergeProperties = sut.mergeProperties(); assertThat(mergeProperties.size(),is(4)); }