Implement metadata lookup by artifact, refactored metadata indexing.
[shibboleth/cpp-opensaml.git] / samltest / saml2 / metadata / FilesystemMetadataProviderTest.h
index a6da0a7..a9c1f83 100644 (file)
  */\r
 \r
 #include "internal.h"\r
+#include <saml/saml2/core/SAML2ArtifactType0004.h>\r
 #include <saml/saml2/metadata/MetadataProvider.h>\r
 \r
 using namespace opensaml::saml2md;\r
+using namespace opensaml::saml2p;\r
 \r
 class FilesystemMetadataProviderTest : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {\r
     XMLCh* entityID;\r
@@ -66,6 +68,13 @@ public:
         TSM_ASSERT_EQUALS("Unexpected number of roles", 1, descriptor->getIDPSSODescriptors().size());\r
         TSM_ASSERT("Role lookup failed", descriptor->getIDPSSODescriptor(supportedProtocol)!=NULL);\r
         TSM_ASSERT("Role lookup failed", descriptor->getIDPSSODescriptor(supportedProtocol2)!=NULL);\r
+\r
+        auto_ptr<SAML2ArtifactType0004> artifact(\r
+            new SAML2ArtifactType0004(SAMLConfig::getConfig().hashSHA1("urn:mace:incommon:washington.edu"),1)\r
+            );\r
+        descriptor = metadataProvider->getEntityDescriptor(artifact.get());\r
+        TSM_ASSERT("Retrieved entity descriptor was null", descriptor!=NULL);\r
+        assertEquals("Entity's ID does not match requested ID", entityID, descriptor->getEntityID());\r
     }\r
 \r
     void testFilesystemWithBlacklists() {\r