Skip to content

Latest commit

 

History

History
67 lines (45 loc) · 2.48 KB

vault.md

File metadata and controls

67 lines (45 loc) · 2.48 KB

Hashicorp Vault Module

Testcontainers module for Vault. Vault is a tool for managing secrets. More information on Vault here.

Usage example

Start Vault container as a @ClassRule:

Starting a Vault container inside_block:vaultContainer

Use CLI to read data from Vault container:

Use CLI to read data inside_block:readFirstSecretPathWithCli

Use Http API to read data from Vault container:

Use Http API to read data inside_block:readFirstSecretPathOverHttpApi

Use client library to read data from Vault container:

Use library to read data inside_block:readWithLibrary

See full example.

Why Vault in Junit tests?

With the increasing popularity of Vault and secret management, applications are now needing to source secrets from Vault. This can prove challenging in the development phase without a running Vault instance readily on hand. This library aims to solve your apps integration testing with Vault. You can also use it to test how your application behaves with Vault by writing different test scenarios in Junit.

Adding this module to your project dependencies

Add the following dependency to your pom.xml/build.gradle file:

=== "Gradle" groovy testImplementation "org.testcontainers:vault:{{latest_version}}" === "Maven" xml <dependency> <groupId>org.testcontainers</groupId> <artifactId>vault</artifactId> <version>{{latest_version}}</version> <scope>test</scope> </dependency>

License

See LICENSE.

Copyright

Copyright (c) 2017 Capital One Services, LLC and other authors.

See AUTHORS for contributors.