MavenWorkspaceReader implements WorkspaceReader { public File findArtifact(Artifact artifact) { MavenModule mavenModule = findModule(artifact); if (mavenModule != null) return mavenModule.getPomFile(); else return null; } MavenWorkspaceReader(WorkspaceFilesystem workspaceFilesystem, ModelProcessor modelProcessor, MavenWorkspaceListener listener);  MavenWorkspaceReader(WorkspaceFilesystem workspaceFilesystem, ModelProcessor modelProcessor); WorkspaceRepository getRepository(); File findArtifact(Artifact artifact); List<String> findVersions(Artifact artifact); MavenModule getRootModule(); List<MavenModule> getMavenModules();  }
@Test public void testFindArtifactPositive() throws MavenWorkspaceReaderException { MavenWorkspaceReader workspaceReader = new MavenWorkspaceReader(workspaceFilesystem, mavenBooter.modelProcessor()); assertThat(workspaceReader.findArtifact(new DefaultArtifact("com.sonatype.example", "projB", "", "pom", "1.0.0-SNAPSHOT")).getAbsoluteFile(), is(new File(repositoryRoot, "pom.xml").getAbsoluteFile())); }
@Test public void testFindArtifactNegative() throws MavenWorkspaceReaderException { MavenWorkspaceReader workspaceReader = new MavenWorkspaceReader(workspaceFilesystem, mavenBooter.modelProcessor()); assertThat(workspaceReader.findArtifact(new DefaultArtifact("com.sonatype.example", "non-existing", "", "pom", "1.0.0-SNAPSHOT")), nullValue()); }