DevManifestReader implements ManifestReader { @Override public PluginMetadata read(Path pluginDirectory) throws PluginException { if (!Files.exists(pluginDirectory) || !Files.isDirectory(pluginDirectory)) { throw new PluginException(String.format("Specified path [%s] should be a directory", pluginDirectory)); } String pluginName = pluginDirectory.getParent().relativize(pluginDirectory).toString(); String pluginVersion = "dev"; return new PluginMetadataContainer(pluginName, pluginVersion, pluginDirectory); }  @Override PluginMetadata read(Path pluginDirectory);  }
@Test public void testRead() throws Exception { DevManifestReader devManifestReader = new DevManifestReader(); PluginMetadata pluginMetadata = devManifestReader.read(pluginDirectory); assertThat(pluginMetadata.getName(), equalTo(DIRECTORY_NAME)); assertThat(pluginMetadata.getVersion(), equalTo("dev")); assertThat(pluginMetadata.getPath(), equalTo(pluginDirectory)); }