use of org.apache.archiva.metadata.generic.GenericMetadataFacetFactory in project archiva by apache.
the class AbstractMetadataRepositoryTest method createTestMetadataFacetFactories.
public static Map<String, MetadataFacetFactory> createTestMetadataFacetFactories() {
Map<String, MetadataFacetFactory> factories = new HashMap<>();
factories.put(TEST_FACET_ID, new MetadataFacetFactory() {
@Override
public MetadataFacet createMetadataFacet() {
return new TestMetadataFacet(TEST_METADATA_VALUE);
}
@Override
public MetadataFacet createMetadataFacet(String repositoryId, String name) {
return new TestMetadataFacet(TEST_METADATA_VALUE);
}
});
// add to ensure we don't accidentally create an empty facet ID.
factories.put("", new MetadataFacetFactory() {
@Override
public MetadataFacet createMetadataFacet() {
return new TestMetadataFacet("", TEST_VALUE);
}
@Override
public MetadataFacet createMetadataFacet(String repositoryId, String name) {
return new TestMetadataFacet("", TEST_VALUE);
}
});
// for the getArtifactsByProjectVersionMetadata tests
factories.put(GenericMetadataFacet.FACET_ID, new GenericMetadataFacetFactory());
return factories;
}
Aggregations