test_class.declarator: expectedException = ExpectedException.none()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public ExpectedException expectedException = ExpectedException.none();
test_class.type: ExpectedException
test_class.var_name: expectedException
test_class.file: wildfly/extensions/src/test/java/org/keycloak/vault/ElytronCSKeyStoreProviderTest.java
test_class.identifier: ElytronCSKeyStoreProviderTest
test_case.body: @Test
      public void testRetrieveSecretUsingCustomFactory() throws Exception {
          ElytronCSKeyStoreProviderFactory factory = null;
          try {
              ProviderConfig config = new ProviderConfig("src/test/resources/org/keycloak/vault/credential-store.p12",
                      "MASK-3u2HNQaMogJJ8VP7J6gRIl;12345678;321", "PKCS12");
              config.setKeyResolvers("FACTORY_PROVIDED");
              factory = new ElytronCSKeyStoreProviderFactory() {
                  @Override
                  protected String getRealmName(KeycloakSession session) {
                      return "test";
                  }
  
                  @Override
                  protected VaultKeyResolver getFactoryResolver() {
                      return (realm, key) -> realm + "###" + key;
                  }
              };
  
              factory.init(config);
              Assert.assertNotNull(Security.getProvider(WildFlyElytronCredentialStoreProvider.getInstance().getName()));
  
              VaultProvider provider = factory.create(null);
              Assert.assertNotNull(provider);
  
              // obtain a secret using a key that exists (matches the key provided by the FACTORY_PROVIDED resolver).
              VaultRawSecret secret = provider.obtainSecret("smtp_key");
              Assert.assertNotNull(secret);
              Assert.assertTrue(secret.get().isPresent());
              Assert.assertThat(secret, SecretContains.secretContains("custom_smtp_secret"));
          } finally {
              if (factory != null) {
                  factory.close();
              }
              Assert.assertNull(Security.getProvider(WildFlyElytronCredentialStoreProvider.getInstance().getName()));
          }
      }
test_case.class_method_signature: ElytronCSKeyStoreProviderTest.testRetrieveSecretUsingCustomFactory()
test_case.full_signature: @Test public void testRetrieveSecretUsingCustomFactory()
test_case.identifier: testRetrieveSecretUsingCustomFactory
test_case.invocations: setKeyResolvers init assertNotNull getProvider getName getInstance create assertNotNull obtainSecret assertNotNull assertTrue isPresent get assertThat secretContains close assertNull getProvider getName getInstance
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testRetrieveSecretUsingCustomFactory()
focal_class.declarator: logger = Logger.getLogger(MethodHandles.lookup().lookupClass())
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = Logger.getLogger(MethodHandles.lookup().lookupClass());
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: credentialStore
focal_class.modifier: private final
focal_class.original_string: private final CredentialStore credentialStore;
focal_class.type: CredentialStore
focal_class.var_name: credentialStore
focal_class.file: wildfly/extensions/src/main/java/org/keycloak/vault/ElytronCSKeyStoreProvider.java
focal_class.identifier: ElytronCSKeyStoreProvider
focal_class.class_method_signature: ElytronCSKeyStoreProvider.ElytronCSKeyStoreProvider(final CredentialStore store, final String realmName, final List<VaultKeyResolver> resolvers)
focal_class.full_signature: public  ElytronCSKeyStoreProvider(final CredentialStore store, final String realmName, final List<VaultKeyResolver> resolvers)
focal_class.identifier: ElytronCSKeyStoreProvider
focal_class.modifiers: public
focal_class.parameters: (final CredentialStore store, final String realmName, final List<VaultKeyResolver> resolvers)
focal_class.signature:  ElytronCSKeyStoreProvider(final CredentialStore store, final String realmName, final List<VaultKeyResolver> resolvers)
focal_class.class_method_signature: ElytronCSKeyStoreProvider.obtainSecretInternal(String vaultSecretId)
focal_class.full_signature: @Override protected VaultRawSecret obtainSecretInternal(String vaultSecretId)
focal_class.identifier: obtainSecretInternal
focal_class.modifiers: @Override protected
focal_class.parameters: (String vaultSecretId)
focal_class.return: VaultRawSecret
focal_class.signature: VaultRawSecret obtainSecretInternal(String vaultSecretId)
focal_class.class_method_signature: ElytronCSKeyStoreProvider.close()
focal_class.full_signature: @Override public void close()
focal_class.identifier: close
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_class.superclass: extends AbstractVaultProvider
focal_method.body: @Override
      public void close() {
      }
focal_method.class_method_signature: ElytronCSKeyStoreProvider.close()
focal_method.full_signature: @Override public void close()
focal_method.identifier: close
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void close()