@Test public void getExpectedJarBaseNameTest() { final String expectedJarBaseName = artifactRequester.getExpectedJarBaseName(mavenCoordinate, ClassifierInformation.DEFAULT_JAR); assertThat(expectedJarBaseName).endsWith(MavenInvokerRequester.JAR_EXTENSION); assertThat(expectedJarBaseName).contains(mavenCoordinate.getName()); assertThat(expectedJarBaseName).contains(mavenCoordinate.getVersion()); assertThat(expectedJarBaseName).doesNotContain("/"); }
String getExpectedJarBaseName(Coordinate mavenCoordinate, ClassifierInformation classifierInformation) { return mavenCoordinate.getName() + "-" + mavenCoordinate.getVersion() + (classifierInformation.classifier.isEmpty() ? JAR_EXTENSION : "-" + classifierInformation.classifier + JAR_EXTENSION); }
IArtifactRequester { String getExpectedJarBaseName(Coordinate mavenCoordinate, ClassifierInformation classifierInformation) { return mavenCoordinate.getName() + "-" + mavenCoordinate.getVersion() + (classifierInformation.classifier.isEmpty() ? JAR_EXTENSION : "-" + classifierInformation.classifier + JAR_EXTENSION); } }
IArtifactRequester { String getExpectedJarBaseName(Coordinate mavenCoordinate, ClassifierInformation classifierInformation) { return mavenCoordinate.getName() + "-" + mavenCoordinate.getVersion() + (classifierInformation.classifier.isEmpty() ? JAR_EXTENSION : "-" + classifierInformation.classifier + JAR_EXTENSION); } IArtifactRequester(); }
IArtifactRequester { String getExpectedJarBaseName(Coordinate mavenCoordinate, ClassifierInformation classifierInformation) { return mavenCoordinate.getName() + "-" + mavenCoordinate.getVersion() + (classifierInformation.classifier.isEmpty() ? JAR_EXTENSION : "-" + classifierInformation.classifier + JAR_EXTENSION); } IArtifactRequester(); abstract Optional<File> requestFile(Coordinate mavenCoordinate, Path targetDirectory, ClassifierInformation classifierInformation); }
IArtifactRequester { String getExpectedJarBaseName(Coordinate mavenCoordinate, ClassifierInformation classifierInformation) { return mavenCoordinate.getName() + "-" + mavenCoordinate.getVersion() + (classifierInformation.classifier.isEmpty() ? JAR_EXTENSION : "-" + classifierInformation.classifier + JAR_EXTENSION); } IArtifactRequester(); abstract Optional<File> requestFile(Coordinate mavenCoordinate, Path targetDirectory, ClassifierInformation classifierInformation); static final String JAR_EXTENSION; }