@Test
public void testRead() throws PluginException {

    final Path FILE = Paths.get("missing-file");
    PluginMetadata pluginMetadata = read(FILE);
    assertThat(pluginMetadata.getName(), equalTo(NAME));
    assertThat(pluginMetadata.getVersion(), equalTo(VERSION));
    assertThat(pluginMetadata.getDate(), equalTo(Optional.of(ZonedDateTime.parse(DATE))));
    assertThat(pluginMetadata.getDescription(), equalTo(Optional.of(DESCRIPTION)));
    assertThat(pluginMetadata.getMaintainer(), equalTo(Optional.of(MAINTAINER)));
    assertThat(pluginMetadata.getDependency(), equalTo(new DependencyContainer(NAME, VERSION)));
    assertThat(pluginMetadata.getPath(), equalTo(FILE));
    List<Dependency> requiredDependencies = pluginMetadata.getRequiredDependencies();
    assertThat(requiredDependencies, hasSize(2));
    Dependency requiredDependency1 = new DependencyContainer("some-plugin");
    Dependency requiredDependency2 = new DependencyContainer("another-plugin", "[0.9,)");
    assertThat(requiredDependencies, contains(requiredDependency1, requiredDependency2));
    List<Dependency> conflictingDependencies = pluginMetadata.getConflictingDependencies();
    assertThat(conflictingDependencies, hasSize(2));
    Dependency conflictingDependency1 = new DependencyContainer("some-conflicting-plugin", "(,1.0]");
    Dependency conflictingDependency2 = new DependencyContainer("another-conflicting-plugin", "[1.1,1.2]");
    assertThat(conflictingDependencies, contains(conflictingDependency1, conflictingDependency2));
    Dependency provided = new DependencyContainer(PROVIDES);
    assertThat(pluginMetadata.getProvidedDependency(), equalTo(Optional.of(provided)));
}