use of org.apache.archiva.rest.api.model.MetadataAddRequest 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"));
}
Aggregations