private SAML2AuthenticationCredentials createCredentialsForTest(boolean includeNotBefore, boolean includeNotOnOrAfter) {
        val nameid = nameIdBuilder.buildObject();
        nameid.setValue("pac4j");
        nameid.setSPNameQualifier("pac4j");
        nameid.setNameQualifier("pac4j");
        nameid.setSPProvidedID("pac4j");

        val conditions = conditionsBuilder.buildObject();

        if (includeNotBefore) {
            conditions.setNotBefore(Instant.now());
        }

        if (includeNotOnOrAfter) {
            conditions.setNotOnOrAfter(Instant.now());
        }

        final List<String> contexts = new ArrayList<>();
        contexts.add("cas-context");

        final List<Attribute> attributes = new ArrayList<>();

        attributes.add(createAttribute("username", "username", "pac4j"));
        attributes.add(createAttribute("displayName", "urn:oid:2.16.840.1.113730.3.1.241", "Pac4j Library"));
        attributes.add(createAttribute("givenName", "urn:oid:2.5.4.42", "developer"));
        attributes.add(createAttribute("surname", "urn:oid:2.5.4.4", "security"));

        val credentials = new SAML2AuthenticationCredentials(SAML2AuthenticationCredentials.SAMLNameID.from(nameid),
            "example.issuer.com",
            SAML2AuthenticationCredentials.SAMLAttribute.from(new SimpleSAML2AttributeConverter(), attributes), conditions, "session-index",
            contexts, List.of(),
            UUID.randomUUID().toString());
        return credentials;
    }
This is {@link SAML2AuthenticatorTests}.
@author Misagh Moayyed
pac4j-saml/src/test/java/org/pac4j/saml/credentials/authenticator/SAML2AuthenticatorTests.java