private KeyStore prepareKeyStore() throws Exception {
        val keyStoreSpiMock = mock(KeyStoreSpi.class);
        val keyStore = new KeyStore(keyStoreSpiMock, null, "test"){ };
        keyStore.load(null);
        when(keyStore.aliases()).thenReturn(Collections.enumeration(Arrays.asList(KEY, VALUE)));
        when(keyStore.entryInstanceOf(KEY, KeyStore.PrivateKeyEntry.class)).thenReturn(false);
        when(keyStore.entryInstanceOf(VALUE, KeyStore.PrivateKeyEntry.class)).thenReturn(true);
        return keyStore;
    }
Tests {@link KeyStoreCredentialProvider}.

@author Jerome Leleu
@since 3.3.0
pac4j-saml/src/test/java/org/pac4j/saml/crypto/KeyStoreCredentialProviderTests.java