Exemplo n.º 1
0
        public async Task TearDown()
        {
            await CleanUpVault();

            var vaultSealingForTestsHelper = new VaultSealingForTestsHelper(_config);
            await vaultSealingForTestsHelper.Seal();
        }
Exemplo n.º 2
0
        public async Task SetUp()
        {
            _config        = new VaultConfig();
            _config.Host   = "localhost:8082";
            _config.Scheme = "http";
            _config.Path   = "api/v1";
            _config.Token  = $"bearer  {TestContext.Parameters["token"]}";

            var vaultSealingForTestsHelper = new VaultSealingForTestsHelper(_config);
            await vaultSealingForTestsHelper.Unseal();

            _vaultService = new VaultService(_config, new TestLogManager(LogLevel.Trace));
            _vaultModule  = new VaultModule(_vaultService, new TestLogManager(LogLevel.Trace));

            provide.Model.Vault.Vault vault = new provide.Model.Vault.Vault();
            vault.Name        = "Test Vault";
            vault.Description = "Test Vault used for test purposes";
            ResultWrapper <provide.Model.Vault.Vault> res = await _vaultModule.vault_createVault(vault);

            if (res.Result != Result.Success || res.Data.Id is null)
            {
                throw new ApplicationException("Failed to create vault");
            }

            _vaultId = res.Data.Id.Value;
        }