Artifact implements Comparable { public static File getFormattedMavenDirectory(File outputDirectory, ArtifactCoordinates artifactCoordinates) { StringBuilder sb = new StringBuilder(); sb.append(artifactCoordinates.getGroupId().replace('.', separatorChar)).append(separatorChar); sb.append(artifactCoordinates.getArtifactId()).append(separatorChar); sb.append(artifactCoordinates.getVersion()).append(separatorChar); return new File(outputDirectory, sb.toString()); } Artifact(ArtifactCoordinates artifactCoordinates, URI uri); ArtifactCoordinates getArtifactCoordinates(); URI getUri(); void setUri(URI uri); @Override String toString(); @Override int compareTo(Object that); @Override boolean equals(Object o); @Override int hashCode(); Artifact copyWithParameterizedUri(); static File getFormattedMavenDirectory(File outputDirectory, ArtifactCoordinates artifactCoordinates); static String getFormattedArtifactFileName(Artifact artifact); void setNewArtifactURI(Artifact newArtifact, File newArtifactFile); static String getPomFileName(Artifact artifact); static String buildMainPOMFileName(ArtifactCoordinates artifactCoordinates); String getPomFileName(); boolean isShared(); void setShared(boolean isShared); String getFormattedArtifactFileName(); File getFormattedMavenDirectory(File repositoryFile); @CheckForNull String[] getPackages(); @CheckForNull String[] getResources(); void setPackages(String[] packages); void setResources(String[] resources); static final String MULE_DOMAIN; }
@Test public void getFormattedMavenDirectoryTest() { File actual = artifact.getFormattedMavenDirectory(outputFolder.getRoot()); File expected = new File(outputFolder.getRoot(), OUTPUT_DIRECTORY); assertThat("Actual formatted output directory is not the expected", actual.getAbsolutePath(), equalTo(expected.getAbsolutePath())); }