Search in sources :

Example 1 with GenericMetadataFacetFactory

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;
}
Also used : HashMap(java.util.HashMap) GenericMetadataFacetFactory(org.apache.archiva.metadata.generic.GenericMetadataFacetFactory) MetadataFacet(org.apache.archiva.metadata.model.MetadataFacet) GenericMetadataFacet(org.apache.archiva.metadata.generic.GenericMetadataFacet) GenericMetadataFacetFactory(org.apache.archiva.metadata.generic.GenericMetadataFacetFactory) MetadataFacetFactory(org.apache.archiva.metadata.model.MetadataFacetFactory)

Aggregations

HashMap (java.util.HashMap)1 GenericMetadataFacet (org.apache.archiva.metadata.generic.GenericMetadataFacet)1 GenericMetadataFacetFactory (org.apache.archiva.metadata.generic.GenericMetadataFacetFactory)1 MetadataFacet (org.apache.archiva.metadata.model.MetadataFacet)1 MetadataFacetFactory (org.apache.archiva.metadata.model.MetadataFacetFactory)1