use of org.apache.archiva.rest.api.services.BrowseService 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.rest.api.services.BrowseService in project archiva by apache.
the class BrowseServiceTest method readArtifactContentTextPom.
@Test
public void readArtifactContentTextPom() throws Exception {
BrowseService browseService = getBrowseService(authorizationHeader, true);
WebClient.client(browseService).accept(MediaType.TEXT_PLAIN);
String text = browseService.getArtifactContentText("commons-logging", "commons-logging", "1.1", null, "pom", null, TEST_REPO_ID).getContent();
log.info("text: {}", text);
assertThat(text).contains("<url>http://jakarta.apache.org/commons/${pom.artifactId.substring(8)}/</url>").contains("<subscribe>commons-dev-subscribe@jakarta.apache.org</subscribe>");
}
use of org.apache.archiva.rest.api.services.BrowseService in project archiva by apache.
the class BrowseServiceTest method getArtifactsByProjectVersionMetadataWithNoRepository.
@Test
public void getArtifactsByProjectVersionMetadataWithNoRepository() throws Exception {
BrowseService browseService = getBrowseService(authorizationHeader, true);
browseService.addMetadata("commons-cli", "commons-cli", "1.0", "wine", "bordeaux", TEST_REPO_ID);
List<Artifact> artifactDownloadInfos = browseService.getArtifactsByProjectVersionMetadata("wine", "bordeaux", null);
assertThat(artifactDownloadInfos).isNotNull().isNotEmpty().hasSize(3);
}
use of org.apache.archiva.rest.api.services.BrowseService in project archiva by apache.
the class BrowseServiceTest method readArtifactContentEntriesFilesAndDirectories.
@Test
public void readArtifactContentEntriesFilesAndDirectories() throws Exception {
BrowseService browseService = getBrowseService(authorizationHeader, true);
List<ArtifactContentEntry> artifactContentEntries = browseService.getArtifactContentEntries("commons-logging", "commons-logging", "1.1", null, null, "org/apache/commons/logging/", TEST_REPO_ID);
log.info("artifactContentEntries: {}", artifactContentEntries);
assertThat(artifactContentEntries).isNotNull().isNotEmpty().hasSize(10).contains(new ArtifactContentEntry("org/apache/commons/logging/impl", false, 4, TEST_REPO_ID), new ArtifactContentEntry("org/apache/commons/logging/LogSource.class", true, 4, TEST_REPO_ID));
}
use of org.apache.archiva.rest.api.services.BrowseService 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);
}
Aggregations