use of uk.gov.ida.saml.metadata.StringBackedMetadataResolver in project verify-hub by alphagov.
the class HubAsIdpMetadataHandlerTest method initializeMetadata.
private MetadataResolver initializeMetadata() {
try {
InitializationService.initialize();
String content = new MetadataFactory().defaultMetadata();
StringBackedMetadataResolver metadataResolver = new StringBackedMetadataResolver(content);
BasicParserPool pool = new BasicParserPool();
pool.initialize();
metadataResolver.setParserPool(pool);
metadataResolver.setId("testResolver");
metadataResolver.setResolveViaPredicatesOnly(true);
metadataResolver.setRequireValidMetadata(true);
EntityDescriptorCriterionPredicateRegistry registry = new EntityDescriptorCriterionPredicateRegistry();
registry.register(EntitiesDescriptorNameCriterion.class, EntitiesDescriptorNamePredicate.class);
metadataResolver.setCriterionPredicateRegistry(registry);
metadataResolver.initialize();
return metadataResolver;
} catch (ComponentInitializationException | InitializationException e) {
throw propagate(e);
}
}
Aggregations