use of com.github.nagyesta.lowkeyvault.http.ApacheHttpClient in project lowkey-vault by nagyesta.
the class LowkeyVaultContainerVanillaTest method testContainerShouldStartUpWhenCalledWithoutVaultNames.
@Test
void testContainerShouldStartUpWhenCalledWithoutVaultNames() {
// given
final LowkeyVaultContainer underTest = new LowkeyVaultContainer(DockerImageName.parse(getCurrentLowkeyVaultImageName()).asCompatibleSubstituteFor(LowkeyVaultContainer.DEFAULT_IMAGE_NAME)).withImagePullPolicy(PullPolicy.defaultPolicy());
// when
underTest.start();
// then
final String endpoint = underTest.getDefaultVaultBaseUrl();
final AuthorityOverrideFunction authorityOverrideFunction = new AuthorityOverrideFunction(underTest.getDefaultVaultAuthority(), underTest.getEndpointAuthority());
final TokenCredential credentials = new BasicAuthenticationCredential(underTest.getUsername(), underTest.getPassword());
verifyConnectionIsWorking(endpoint, new ApacheHttpClient(authorityOverrideFunction), credentials);
}
use of com.github.nagyesta.lowkeyvault.http.ApacheHttpClient in project lowkey-vault by nagyesta.
the class LowkeyVaultContainerJupiterTest method testContainerShouldStartUpWhenCalledWithValidNames.
@Test
void testContainerShouldStartUpWhenCalledWithValidNames() {
// given + when test container is created
// then
final String endpoint = underTest.getVaultBaseUrl(VAULT_NAME);
final AuthorityOverrideFunction authorityOverrideFunction = new AuthorityOverrideFunction(underTest.getVaultAuthority(VAULT_NAME), underTest.getEndpointAuthority());
final TokenCredential credentials = new BasicAuthenticationCredential(underTest.getUsername(), underTest.getPassword());
verifyConnectionIsWorking(endpoint, new ApacheHttpClient(authorityOverrideFunction), credentials);
}
use of com.github.nagyesta.lowkeyvault.http.ApacheHttpClient in project lowkey-vault by nagyesta.
the class LowkeyVaultContainerVanillaTest method testContainerShouldStartUpWhenCalledWithValidNames.
@Test
void testContainerShouldStartUpWhenCalledWithValidNames() {
// given
final LowkeyVaultContainer underTest = new LowkeyVaultContainer(DockerImageName.parse(getCurrentLowkeyVaultImageName()).asCompatibleSubstituteFor(LowkeyVaultContainer.DEFAULT_IMAGE_NAME), Collections.singleton(VAULT_NAME)).withImagePullPolicy(PullPolicy.defaultPolicy());
// when
underTest.start();
// then
final String endpoint = underTest.getVaultBaseUrl(VAULT_NAME);
final AuthorityOverrideFunction authorityOverrideFunction = new AuthorityOverrideFunction(underTest.getVaultAuthority(VAULT_NAME), underTest.getEndpointAuthority());
final TokenCredential credentials = new BasicAuthenticationCredential(underTest.getUsername(), underTest.getPassword());
verifyConnectionIsWorking(endpoint, new ApacheHttpClient(authorityOverrideFunction), credentials);
}
Aggregations