### Question:
MavenArtifactDiscoveryService implements ArtifactDiscoveryService { @Override public File discoverArtifact(final Artifact artifact) throws ArtifactNotFoundException { final File file = new File(toFullPath(localRepoPath, artifact.toFileName())); if (!file.exists()) { runMavenCopy(artifact); } return file; } @Inject  MavenArtifactDiscoveryService(final JarvizConfig config); @Override File discoverArtifact(final Artifact artifact);  }### Answer:
@Test public void testDiscoverArtifact_Success() throws ArtifactNotFoundException { final Artifact artifact = new Artifact.Builder() .groupId("org.ow2.asm") .artifactId("asm") .version("7.1") .build(); final File file = artifactDiscoveryService.discoverArtifact(artifact); assertThat(file).exists(); }
@Test(expected = ArtifactNotFoundException.class) public void testDiscoverArtifact_Fail() throws ArtifactNotFoundException { final Artifact artifact = new Artifact.Builder() .groupId("__my_invalid_group__") .artifactId("__my_invalid_artifact__") .version("0") .build(); artifactDiscoveryService.discoverArtifact(artifact); }