@Test
void shouldWorkWhenRegistryIsReloadedAndVaultIsRunning() throws InterruptedException {

  VaultInstance vaultInstance = vaultContainerExtension.startNewVaultInstance();
  vaultInstance.putSecrets(
      VAULT_SECRETS_PATH1, "top_secret=password1", "db_password=dbpassword1");
  String address = vaultInstance.address();
  String rootToken = vaultInstance.rootToken();
  ConfigRegistrySettings settings =
      ConfigRegistrySettings.builder()
          .addLastSource(
              "vault",
              VaultConfigSource.builder()
                  .config(vaultConfig -> vaultConfig.address(address).token(rootToken))
                  .addSecretsPath(VAULT_SECRETS_PATH1)
                  .build())
          .jmxEnabled(false)
          .reloadIntervalSec(1)
          .build();
  ConfigRegistry configRegistry = ConfigRegistry.create(settings);
  StringConfigProperty configProperty = configRegistry.stringProperty("top_secret");
  assertThat(configProperty.value().get(), containsString("password1"));
  vaultInstance.putSecrets(VAULT_SECRETS_PATH1, " top_secret=new_password");
  TimeUnit.SECONDS.sleep(2);
  assertThat(configProperty.value().get(), containsString("new_password"));
}