use of org.apache.archiva.maven.model.Artifact in project archiva by apache.
the class BrowseServiceTest method getArtifactDownloadInfos.
@Test
public void getArtifactDownloadInfos() throws Exception {
BrowseService browseService = getBrowseService(authorizationHeader, true);
List<Artifact> artifactDownloadInfos = browseService.getArtifactDownloadInfos("commons-logging", "commons-logging", "1.1", TEST_REPO_ID);
log.info("artifactDownloadInfos {}", artifactDownloadInfos);
assertThat(artifactDownloadInfos).isNotNull().isNotEmpty().hasSize(3);
}
use of org.apache.archiva.maven.model.Artifact in project archiva by apache.
the class BrowseServiceTest method getArtifactsByProperty.
@Test
public void getArtifactsByProperty() throws Exception {
// START SNIPPET: get-artifacts-by-property
BrowseService browseService = getBrowseService(authorizationHeader, true);
tryAssert(() -> {
List<Artifact> artifactDownloadInfos = browseService.getArtifactsByProperty("org.name", "The Apache Software Foundation", TEST_REPO_ID);
assertThat(artifactDownloadInfos).isNotNull().isNotEmpty().hasSize(7);
// END SNIPPET: get-artifacts-by-property
});
}
use of org.apache.archiva.maven.model.Artifact in project archiva by apache.
the class BrowseServiceTest method getArtifactsByProjectVersionMetadata.
@Test
public void getArtifactsByProjectVersionMetadata() throws Exception {
// START SNIPPET: get-artifacts-by-project-version-metadata
BrowseService browseService = getBrowseService(authorizationHeader, true);
browseService.addMetadata("commons-cli", "commons-cli", "1.0", "wine", "bordeaux", TEST_REPO_ID);
tryAssert(() -> {
List<Artifact> artifactDownloadInfos = browseService.getArtifactsByProjectVersionMetadata("wine", "bordeaux", TEST_REPO_ID);
assertThat(artifactDownloadInfos).isNotNull().isNotEmpty().hasSize(3);
// END SNIPPET: get-artifacts-by-project-version-metadata
});
}
use of org.apache.archiva.maven.model.Artifact in project archiva by apache.
the class BrowseServiceTest method getArtifactsByMetadata.
@Test
public void getArtifactsByMetadata() throws Exception {
// START SNIPPET: get-artifacts-by-metadata
BrowseService browseService = getBrowseService(authorizationHeader, true);
List<Artifact> artifactDownloadInfos = browseService.getArtifactsByMetadata("type", "pom", TEST_REPO_ID);
assertThat(artifactDownloadInfos).isNotNull().isNotEmpty().hasSize(11);
// END SNIPPET: get-artifacts-by-metadata
}
use of org.apache.archiva.maven.model.Artifact in project archiva by apache.
the class BrowseServiceTest method getArtifactsByProjectVersionMetadataWithNoRepository.
@Test
public void getArtifactsByProjectVersionMetadataWithNoRepository() throws Exception {
final BrowseService browseService = getBrowseService(authorizationHeader, true);
browseService.addMetadata("commons-cli", "commons-cli", "1.0", "wine", "bordeaux", TEST_REPO_ID);
tryAssert(() -> {
List<Artifact> artifactDownloadInfos = null;
try {
artifactDownloadInfos = browseService.getArtifactsByProjectVersionMetadata("wine", "bordeaux", null);
} catch (ArchivaRestServiceException e) {
throw new AssertionError("ArchivaRestServiceException", e);
}
assertThat(artifactDownloadInfos).isNotNull().isNotEmpty().hasSize(3);
});
}
Aggregations