public void testResolution() throws Exception {
    ApplicationContext ac =
        createSpringContext(
            new String[] {
              DATA_PATH + "/config/base-config.xml",
              DATA_PATH + "/config/attribute/service-config.xml",
            });

    ParserPool parserPool = new BasicParserPool();

    HTTPMetadataProvider mdProvider =
        new HTTPMetadataProvider(
            "http://wayf.incommonfederation.org/InCommon/InCommon-metadata.xml", 5000);
    mdProvider.setParserPool(parserPool);
    mdProvider.initialize();

    RelyingPartyConfiguration rpConfig = new RelyingPartyConfiguration("mySP", "myIdP");

    BaseSAMLProfileRequestContext context = new BaseSAMLProfileRequestContext();
    context.setMetadataProvider(mdProvider);
    context.setRelyingPartyConfiguration(rpConfig);
    context.setPrincipalName("aUser");

    SAML2AttributeAuthority aa =
        (SAML2AttributeAuthority) ac.getBean("shibboleth.SAML2AttributeAuthority");
    Map<String, BaseAttribute> attributes = aa.getAttributes(context);

    assertEquals(3, attributes.size());

    assertNotNull(aa.buildAttributeStatement(null, attributes.values()));
  }
 @Bean
 @Qualifier("idp-ssocircle")
 public ExtendedMetadataDelegate ssoCircleExtendedMetadataProvider()
     throws MetadataProviderException {
   String idpSSOCircleMetadataURL = "https://idp.ssocircle.com/idp-meta.xml";
   Timer backgroundTaskTimer = new Timer(true);
   HTTPMetadataProvider httpMetadataProvider =
       new HTTPMetadataProvider(backgroundTaskTimer, httpClient(), idpSSOCircleMetadataURL);
   httpMetadataProvider.setParserPool(parserPool());
   ExtendedMetadataDelegate extendedMetadataDelegate =
       new ExtendedMetadataDelegate(httpMetadataProvider, extendedMetadata());
   extendedMetadataDelegate.setMetadataTrustCheck(true);
   extendedMetadataDelegate.setMetadataRequireSignature(false);
   return extendedMetadataDelegate;
 }