use of org.apache.archiva.rest.api.services.BrowseService in project archiva by apache.
the class BrowseServiceTest method browsegroupId.
@Test
public void browsegroupId() throws Exception {
BrowseService browseService = getBrowseService(authorizationHeader, false);
BrowseResult browseResult = browseService.browseGroupId("org.apache", TEST_REPO_ID);
assertThat(browseResult).isNotNull();
//
assertThat(browseResult.getBrowseResultEntries()).isNotNull().isNotEmpty().hasSize(//
2).contains(//
new BrowseResultEntry("org.apache.felix", false), new BrowseResultEntry("org.apache.karaf.features", false));
}
use of org.apache.archiva.rest.api.services.BrowseService in project archiva by apache.
the class BrowseServiceTest method metadatainbatchmode.
@Test
public void metadatainbatchmode() throws Exception {
scanRepo(TEST_REPO_ID);
waitForScanToComplete(TEST_REPO_ID);
BrowseService browseService = getBrowseService(authorizationHeader, false);
Map<String, String> inputMetadata = new HashMap<>(3);
inputMetadata.put("buildNumber", "1");
inputMetadata.put("author", "alecharp");
inputMetadata.put("jenkins_version", "1.486");
MetadataAddRequest metadataAddRequest = new MetadataAddRequest();
metadataAddRequest.setGroupId("commons-cli");
metadataAddRequest.setArtifactId("commons-cli");
metadataAddRequest.setVersion("1.0");
metadataAddRequest.setMetadatas(inputMetadata);
browseService.importMetadata(metadataAddRequest, TEST_REPO_ID);
Map<String, String> metadatas = toMap(browseService.getMetadatas("commons-cli", "commons-cli", "1.0", TEST_REPO_ID));
assertThat(metadatas).isNotNull().isNotEmpty().contains(MapEntry.entry("buildNumber", "1")).contains(MapEntry.entry("author", "alecharp")).contains(MapEntry.entry("jenkins_version", "1.486"));
}
use of org.apache.archiva.rest.api.services.BrowseService in project archiva by apache.
the class BrowseServiceTest method readArtifactContentEntriesRootPath.
@Test
public void readArtifactContentEntriesRootPath() throws Exception {
BrowseService browseService = getBrowseService(authorizationHeader, true);
List<ArtifactContentEntry> artifactContentEntries = browseService.getArtifactContentEntries("commons-logging", "commons-logging", "1.1", null, null, "org/", TEST_REPO_ID);
log.info("artifactContentEntries: {}", artifactContentEntries);
//
assertThat(artifactContentEntries).isNotNull().isNotEmpty().hasSize(//
1).contains(new ArtifactContentEntry("org/apache", false, 1, TEST_REPO_ID));
}
use of org.apache.archiva.rest.api.services.BrowseService 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);
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.rest.api.services.BrowseService in project archiva by apache.
the class BrowseServiceTest method artifactsNumber.
@Test
public void artifactsNumber() throws Exception {
BrowseService browseService = getBrowseService(authorizationHeader, true);
// WebClient.client( browseService ).accept( MediaType.TEXT_PLAIN );
int number = browseService.getArtifacts(TEST_REPO_ID).size();
log.info("getArtifactsNumber: {}", number);
assertTrue(number > 1);
}
Aggregations