PluginPropertiesUtil { public String getVersion() { return VERSION_PLACEHOLDER; } PluginPropertiesUtil();  PluginPropertiesUtil( String versionPropertiesFile ); Properties loadPluginProperties( PluginInterface plugin ); String getVersion(); static final String PLUGIN_PROPERTIES_FILE; static final String VERSION_PROPERTIES_FILE; }
@Test public void getVersion() { PluginPropertiesUtil util = new PluginPropertiesUtil(); assertNotNull( "Should never be null", util.getVersion() ); }
@Test public void testGetVersionFromNonDefaultLocation() { PluginPropertiesUtil ppu = new PluginPropertiesUtil( "test-version.properties" ); String version = ppu.getVersion(); assertEquals( "X.Y.Z-TEST", version ); }
@Test public void testGetVersionFromNonExistingLocation() { PluginPropertiesUtil ppu = new PluginPropertiesUtil( "non-existing-version.properties" ); String version = ppu.getVersion(); assertEquals( "@VERSION@", version ); }