@Test
    void verifyBadEntityKeys() {
        val factory = new BasicX509CredentialFactoryBean();
        factory.setEntityResource(new ClassPathResource("keys/xyz.pem"));
        factory.setCertificateResources(List.of(new ClassPathResource("keys/cert.pem")));
        assertThrows(BeanCreationException.class, factory::getObject);
    }
This is {@link BasicX509CredentialFactoryBeanTests}.

@author Misagh Moayyed
@since 6.2.0
support/cas-server-support-saml-core/src/test/java/org/apereo/cas/support/saml/util/credential/BasicX509CredentialFactoryBeanTests.java