@Override
    public final XMLObject getEntityDescriptorElement() {
        try {
            var idpEntityId = determineIdentityProviderEntityId();
            return resolve().resolveSingle(new CriteriaSet(new EntityIdCriterion(idpEntityId)));
        } catch (final ResolverException e) {
            throw new SAMLException("Error initializing idpMetadataProvider", e);
        }
    }
@Test
    public void resolveExpiringMetadata() {
        var configuration = new SAML2Configuration();
        configuration.setIdentityProviderMetadataResource(new ClassPathResource("expired-idp-metadata.xml"));
        metadataResolver = new SAML2IdentityProviderMetadataResolver(configuration);
        metadataResolver.init();
        assertNull(metadataResolver.getEntityDescriptorElement());
    }