use of org.apache.archiva.repository.content.DataItem in project archiva by apache.
the class ManagedDefaultRepositoryContentTest method testNewItemStreamWithNamespace2.
@Test
public void testNewItemStreamWithNamespace2() {
ItemSelector selector = ArchivaItemSelector.builder().withNamespace("org.apache.maven").recurse().build();
Stream<? extends ContentItem> stream = repoContent.newItemStream(selector, false);
List<? extends ContentItem> result = stream.collect(Collectors.toList());
assertEquals(170, result.size());
assertEquals(92, result.stream().filter(a -> a instanceof DataItem).count());
}
use of org.apache.archiva.repository.content.DataItem in project archiva by apache.
the class ManagedDefaultRepositoryContentTest method getExistingMetadataItem.
@Test
public void getExistingMetadataItem() {
// org/apache/maven/some-ejb/1.0
ArchivaItemSelector versionSelector = ArchivaItemSelector.builder().withNamespace("org.apache.maven").withProjectId("some-ejb").withVersion("1.0").build();
Version version = repoContent.getVersion(versionSelector);
DataItem metaData = repoContent.getMetadataItem(version);
assertTrue(metaData.exists());
assertEquals("/org/apache/maven/some-ejb/1.0/maven-metadata.xml", metaData.getAsset().getPath());
}
Aggregations