CheckstylePropertiesResolver implements PropertyResolver { @Override public String resolve(String name) { return (String) backingProperties.get(CheckstyleSourceCodeFileAnalyzerPlugin.class.getName() + "." + name); } CheckstylePropertiesResolver(Properties backingProperties); @Override String resolve(String name);  }
@Test void existingPropertiesAreResolved() { Properties properties = new Properties(); properties.put(CheckstyleSourceCodeFileAnalyzerPlugin.class.getName() + ".property1", "value1"); CheckstylePropertiesResolver resolver = new CheckstylePropertiesResolver(properties); Assertions.assertEquals("value1", resolver.resolve("property1")); }
@Test void missingPropertiesAreNotResolved() { Properties properties = new Properties(); properties.put( CheckstyleSourceCodeFileAnalyzerPlugin.class.getName() + ".existingProperty", "existingValue"); CheckstylePropertiesResolver resolver = new CheckstylePropertiesResolver(properties); Assertions.assertNull(resolver.resolve("missingProperty")); }