typo fixes

This commit is contained in:
Stefan Kalscheuer 2020-04-25 13:04:39 +02:00
parent 46461f482a
commit 9f80a7dada
17 changed files with 62 additions and 62 deletions

View File

@ -20,8 +20,8 @@ Java Vault Connector is a connector library for [Vault](https://www.vaultproject
* AppRole (register and authenticate) * AppRole (register and authenticate)
* AppID (register and authenticate) [_deprecated_] * AppID (register and authenticate) [_deprecated_]
* Tokens * Tokens
* Creation and lookup of tokens * Creation and lookup of tokens and token roles
* TokenBuilder for speaking creation of complex configuraitons * TokenBuilder for speaking creation of complex configurations
* Secrets * Secrets
* Read secrets * Read secrets
* Write secrets * Write secrets

View File

@ -31,7 +31,7 @@ import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
* Vault Connector implementatin using Vault's HTTP API. * Vault Connector implementation using Vault's HTTP API.
* *
* @author Stefan Kalscheuer * @author Stefan Kalscheuer
* @since 0.1 * @since 0.1
@ -605,7 +605,7 @@ public class HTTPVaultConnector implements VaultConnector {
/** /**
* Common method to bundle secret version operations. * Common method to bundle secret version operations.
* *
* @param mount Secret store mountpoint (without leading or trailing slash). * @param mount Secret store mount point (without leading or trailing slash).
* @param pathPart Path part to query. * @param pathPart Path part to query.
* @param key Secret key. * @param key Secret key.
* @param versions Versions to handle. * @param versions Versions to handle.

View File

@ -91,7 +91,7 @@ public interface VaultConnector extends AutoCloseable, Serializable {
HealthResponse getHealth() throws VaultConnectorException; HealthResponse getHealth() throws VaultConnectorException;
/** /**
* Get all availale authentication backends. * Get all available authentication backends.
* *
* @return List of backends * @return List of backends
* @throws VaultConnectorException on error * @throws VaultConnectorException on error
@ -232,7 +232,7 @@ public interface VaultConnector extends AutoCloseable, Serializable {
/** /**
* Delete AppRole role from Vault. * Delete AppRole role from Vault.
* *
* @param roleName The role anme * @param roleName The role name
* @return {@code true} on success * @return {@code true} on success
* @throws VaultConnectorException on error * @throws VaultConnectorException on error
*/ */
@ -430,7 +430,7 @@ public interface VaultConnector extends AutoCloseable, Serializable {
* Path {@code <mount>/data/<key>} is read here. * Path {@code <mount>/data/<key>} is read here.
* Only available for KV v2 secrets. * Only available for KV v2 secrets.
* *
* @param mount Secret store mountpoint (without leading or trailing slash). * @param mount Secret store mount point (without leading or trailing slash).
* @param key Secret identifier * @param key Secret identifier
* @return Secret response * @return Secret response
* @throws VaultConnectorException on error * @throws VaultConnectorException on error
@ -462,7 +462,7 @@ public interface VaultConnector extends AutoCloseable, Serializable {
* Path {@code <mount>/data/<key>} is written here. * Path {@code <mount>/data/<key>} is written here.
* Only available for KV v2 secrets. * Only available for KV v2 secrets.
* *
* @param mount Secret store mountpoint (without leading or trailing slash). * @param mount Secret store mount point (without leading or trailing slash).
* @param key Secret identifier * @param key Secret identifier
* @param data Secret content. Value must be be JSON serializable. * @param data Secret content. Value must be be JSON serializable.
* @return Metadata for the created/updated secret. * @return Metadata for the created/updated secret.
@ -479,7 +479,7 @@ public interface VaultConnector extends AutoCloseable, Serializable {
* Path {@code <mount>/data/<key>} is written here. * Path {@code <mount>/data/<key>} is written here.
* Only available for KV v2 secrets. * Only available for KV v2 secrets.
* *
* @param mount Secret store mountpoint (without leading or trailing slash). * @param mount Secret store mount point (without leading or trailing slash).
* @param key Secret identifier * @param key Secret identifier
* @param data Secret content. Value must be be JSON serializable. * @param data Secret content. Value must be be JSON serializable.
* @param cas Use Check-And-Set operation, i.e. only allow writing if current version matches this value. * @param cas Use Check-And-Set operation, i.e. only allow writing if current version matches this value.
@ -511,10 +511,10 @@ public interface VaultConnector extends AutoCloseable, Serializable {
* Path {@code <mount>/data/<key>} is read here. * Path {@code <mount>/data/<key>} is read here.
* Only available for KV v2 secrets. * Only available for KV v2 secrets.
* *
* @param mount Secret store mountpoint (without leading or trailing slash). * @param mount Secret store mount point (without leading or trailing slash).
* @param key Secret identifier * @param key Secret identifier
* @param version Version to read. If {@code null} or zero, the latest version will be returned. * @param version Version to read. If {@code null} or zero, the latest version will be returned.
* @return Secret responsef * @return Secret response.
* @throws VaultConnectorException on error * @throws VaultConnectorException on error
* @since 0.8 * @since 0.8
*/ */
@ -556,7 +556,7 @@ public interface VaultConnector extends AutoCloseable, Serializable {
* Path {@code <mount>/metadata/<key>} is read here. * Path {@code <mount>/metadata/<key>} is read here.
* Only available for KV v2 secrets. * Only available for KV v2 secrets.
* *
* @param mount Secret store mountpoint (without leading or trailing slash). * @param mount Secret store mount point (without leading or trailing slash).
* @param key Secret identifier * @param key Secret identifier
* @return Metadata response * @return Metadata response
* @throws VaultConnectorException on error * @throws VaultConnectorException on error
@ -570,7 +570,7 @@ public interface VaultConnector extends AutoCloseable, Serializable {
* Path {@code <mount>/metadata/<key>} is written here. * Path {@code <mount>/metadata/<key>} is written here.
* Only available for KV v2 secrets. * Only available for KV v2 secrets.
* *
* @param mount Secret store mountpoint (without leading or trailing slash). * @param mount Secret store mount point (without leading or trailing slash).
* @param key Secret identifier * @param key Secret identifier
* @param maxVersions Maximum number of versions (fallback to backend default if {@code null}) * @param maxVersions Maximum number of versions (fallback to backend default if {@code null})
* @param casRequired Specify if Check-And-Set is required for this secret. * @param casRequired Specify if Check-And-Set is required for this secret.
@ -710,7 +710,7 @@ public interface VaultConnector extends AutoCloseable, Serializable {
* <br> * <br>
* Only available for KV v2 stores. * Only available for KV v2 stores.
* *
* @param mount Secret store mountpoint (without leading or trailing slash). * @param mount Secret store mount point (without leading or trailing slash).
* @param key Secret path. * @param key Secret path.
* @throws VaultConnectorException on error * @throws VaultConnectorException on error
* @since 0.8 * @since 0.8
@ -737,7 +737,7 @@ public interface VaultConnector extends AutoCloseable, Serializable {
* Prefix {@code secret/} is automatically added to path. * Prefix {@code secret/} is automatically added to path.
* Only available for KV v2 stores. * Only available for KV v2 stores.
* *
* @param mount Secret store mountpoint (without leading or trailing slash). * @param mount Secret store mount point (without leading or trailing slash).
* @param key Secret path. * @param key Secret path.
* @throws VaultConnectorException on error * @throws VaultConnectorException on error
* @since 0.8 * @since 0.8
@ -763,7 +763,7 @@ public interface VaultConnector extends AutoCloseable, Serializable {
* <br> * <br>
* Only available for KV v2 stores. * Only available for KV v2 stores.
* *
* @param mount Secret store mountpoint (without leading or trailing slash). * @param mount Secret store mount point (without leading or trailing slash).
* @param key Secret path. * @param key Secret path.
* @param versions Versions of the secret to delete. * @param versions Versions of the secret to delete.
* @throws VaultConnectorException on error * @throws VaultConnectorException on error
@ -788,7 +788,7 @@ public interface VaultConnector extends AutoCloseable, Serializable {
* Undelete (restore) secret versions from Vault. * Undelete (restore) secret versions from Vault.
* Only available for KV v2 stores. * Only available for KV v2 stores.
* *
* @param mount Secret store mountpoint (without leading or trailing slash). * @param mount Secret store mount point (without leading or trailing slash).
* @param key Secret path. * @param key Secret path.
* @param versions Versions of the secret to undelete. * @param versions Versions of the secret to undelete.
* @throws VaultConnectorException on error * @throws VaultConnectorException on error
@ -813,7 +813,7 @@ public interface VaultConnector extends AutoCloseable, Serializable {
* Destroy secret versions from Vault. * Destroy secret versions from Vault.
* Only available for KV v2 stores. * Only available for KV v2 stores.
* *
* @param mount Secret store mountpoint (without leading or trailing slash). * @param mount Secret store mount point (without leading or trailing slash).
* @param key Secret path. * @param key Secret path.
* @param versions Versions of the secret to destroy. * @param versions Versions of the secret to destroy.
* @throws VaultConnectorException on error * @throws VaultConnectorException on error

View File

@ -33,7 +33,7 @@ import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate; import java.security.cert.X509Certificate;
/** /**
* Vault Connector Factory implementation for HTTP Vault connectors. * Vault Connector Builder implementation for HTTP Vault connectors.
* *
* @author Stefan Kalscheuer * @author Stefan Kalscheuer
* @since 0.8.0 * @since 0.8.0
@ -162,7 +162,7 @@ public final class HTTPVaultConnectorBuilder implements VaultConnectorBuilder {
} }
/** /**
* Add a trusted CA certifiate for HTTPS connections. * Add a trusted CA certificate for HTTPS connections.
* *
* @param cert path to certificate file * @param cert path to certificate file
* @return self * @return self
@ -179,7 +179,7 @@ public final class HTTPVaultConnectorBuilder implements VaultConnectorBuilder {
} }
/** /**
* Add a trusted CA certifiate for HTTPS connections. * Add a trusted CA certificate for HTTPS connections.
* *
* @param cert path to certificate file * @param cert path to certificate file
* @return self * @return self

View File

@ -107,7 +107,7 @@ public final class HTTPVaultConnectorFactory extends VaultConnectorFactory {
} }
/** /**
* Add a trusted CA certifiate for HTTPS connections. * Add a trusted CA certificate for HTTPS connections.
* *
* @param cert path to certificate file * @param cert path to certificate file
* @return self * @return self
@ -120,7 +120,7 @@ public final class HTTPVaultConnectorFactory extends VaultConnectorFactory {
} }
/** /**
* Add a trusted CA certifiate for HTTPS connections. * Add a trusted CA certificate for HTTPS connections.
* *
* @param cert path to certificate file * @param cert path to certificate file
* @return self * @return self

View File

@ -28,7 +28,7 @@ final class Error {
static final String UNEXPECTED_RESPONSE = "Received response where none was expected"; static final String UNEXPECTED_RESPONSE = "Received response where none was expected";
static final String URI_FORMAT = "Invalid URI format"; static final String URI_FORMAT = "Invalid URI format";
static final String RESPONSE_CODE = "Invalid response code"; static final String RESPONSE_CODE = "Invalid response code";
static final String INIT_SSL_CONTEXT = "Unable to intialize SSLContext"; static final String INIT_SSL_CONTEXT = "Unable to initialize SSLContext";
/** /**
* Constructor hidden, this class should not be instantiated. * Constructor hidden, this class should not be instantiated.

View File

@ -340,7 +340,7 @@ public final class RequestHelper implements Serializable {
/* Fail on different error code and/or no retries left */ /* Fail on different error code and/or no retries left */
handleError(response); handleError(response);
/* Throw exception withoud details, if response entity is empty. */ /* Throw exception without details, if response entity is empty. */
throw new InvalidResponseException(Error.RESPONSE_CODE, throw new InvalidResponseException(Error.RESPONSE_CODE,
response.getStatusLine().getStatusCode()); response.getStatusLine().getStatusCode());
} }
@ -362,7 +362,7 @@ public final class RequestHelper implements Serializable {
* Create a custom socket factory from trusted CA certificate. * Create a custom socket factory from trusted CA certificate.
* *
* @return The factory. * @return The factory.
* @throws TlsException An error occured during initialization of the SSL context. * @throws TlsException An error occurred during initialization of the SSL context.
* @since 0.8.0 * @since 0.8.0
*/ */
private SSLConnectionSocketFactory createSSLSocketFactory() throws TlsException { private SSLConnectionSocketFactory createSSLSocketFactory() throws TlsException {
@ -376,7 +376,7 @@ public final class RequestHelper implements Serializable {
TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
tmf.init(keyStore); tmf.init(keyStore);
// Create context usint this TrustManager. // Create context using this TrustManager.
SSLContext context = SSLContext.getInstance(tlsVersion); SSLContext context = SSLContext.getInstance(tlsVersion);
context.init(null, tmf.getTrustManagers(), new SecureRandom()); context.init(null, tmf.getTrustManagers(), new SecureRandom());

View File

@ -198,7 +198,7 @@ public final class AppRole {
} }
/** /**
* @return list of bound CIDR subnets of assiciated tokens * @return list of bound CIDR subnets of associated tokens
* @since 0.9 * @since 0.9
*/ */
public List<String> getTokenBoundCidrs() { public List<String> getTokenBoundCidrs() {
@ -578,22 +578,22 @@ public final class AppRole {
/** /**
* Set number of uses for sectet IDs. * Set number of uses for sectet IDs.
* *
* @param secredIdNumUses the number of uses * @param secretIdNumUses the number of uses
* @return self * @return self
*/ */
public Builder withSecretIdNumUses(final Integer secredIdNumUses) { public Builder withSecretIdNumUses(final Integer secretIdNumUses) {
this.secretIdNumUses = secredIdNumUses; this.secretIdNumUses = secretIdNumUses;
return this; return this;
} }
/** /**
* Set default sectet ID TTL in seconds. * Set default sectet ID TTL in seconds.
* *
* @param secredIdTtl the TTL * @param secretIdTtl the TTL
* @return self * @return self
*/ */
public Builder withSecretIdTtl(final Integer secredIdTtl) { public Builder withSecretIdTtl(final Integer secretIdTtl) {
this.secretIdTtl = secredIdTtl; this.secretIdTtl = secretIdTtl;
return this; return this;
} }

View File

@ -181,24 +181,24 @@ public final class AppRoleBuilder {
} }
/** /**
* Set number of uses for sectet IDs. * Set number of uses for secret IDs.
* *
* @param secredIdNumUses the number of uses * @param secretIdNumUses the number of uses
* @return self * @return self
*/ */
public AppRoleBuilder withSecretIdNumUses(final Integer secredIdNumUses) { public AppRoleBuilder withSecretIdNumUses(final Integer secretIdNumUses) {
this.secretIdNumUses = secredIdNumUses; this.secretIdNumUses = secretIdNumUses;
return this; return this;
} }
/** /**
* Set default sectet ID TTL in seconds. * Set default secret ID TTL in seconds.
* *
* @param secredIdTtl the TTL * @param secretIdTtl the TTL
* @return self * @return self
*/ */
public AppRoleBuilder withSecretIdTtl(final Integer secredIdTtl) { public AppRoleBuilder withSecretIdTtl(final Integer secretIdTtl) {
this.secretIdTtl = secredIdTtl; this.secretIdTtl = secretIdTtl;
return this; return this;
} }

View File

@ -136,14 +136,14 @@ public final class TokenRole {
} }
/** /**
* @return Is Roken Role orphan? * @return Is Token Role orphan?
*/ */
public Boolean getOrphan() { public Boolean getOrphan() {
return orphan; return orphan;
} }
/** /**
* @return Is Roken Role renewable? * @return Is Token Role renewable?
*/ */
public Boolean getRenewable() { public Boolean getRenewable() {
return renewable; return renewable;

View File

@ -25,7 +25,7 @@ import java.io.IOException;
import java.util.Map; import java.util.Map;
/** /**
* Vault response for a single secret version metatada, i.e. after update (KV v2). * Vault response for a single secret version metadata, i.e. after update (KV v2).
* *
* @author Stefan Kalscheuer * @author Stefan Kalscheuer
* @since 0.8 * @since 0.8

View File

@ -83,7 +83,7 @@ public final class AuthData {
} }
/** /**
* @return List of policies associated with the ooken * @return List of policies associated with the token
* @since 0.9 * @since 0.9
*/ */
public List<String> getTokenPolicies() { public List<String> getTokenPolicies() {

View File

@ -151,7 +151,7 @@ public class HTTPVaultConnectorOfflineTest {
} }
/** /**
* Test constductors of the {@link HTTPVaultConnector} class. * Test constructors of the {@link HTTPVaultConnector} class.
*/ */
@Test @Test
public void constructorTest() throws IOException, CertificateException { public void constructorTest() throws IOException, CertificateException {

View File

@ -948,8 +948,8 @@ public class HTTPVaultConnectorTest {
try { try {
AppRoleResponse res = connector.lookupAppRole(roleName); AppRoleResponse res = connector.lookupAppRole(roleName);
// Note: As of Vault 0.8.3 default policy is not added automatically, so this test should return 1, not 2. // Note: As of Vault 0.8.3 default policy is not added automatically, so this test should return 1, not 2.
assertThat("Role lookuo returned wrong policy count (before Vault 0.8.3 is should be 2)", res.getRole().getPolicies(), hasSize(1)); assertThat("Role lookup returned wrong policy count (before Vault 0.8.3 is should be 2)", res.getRole().getPolicies(), hasSize(1));
assertThat("Role lookuo returned wrong policies", res.getRole().getPolicies(), hasItem("testpolicy")); assertThat("Role lookup returned wrong policies", res.getRole().getPolicies(), hasItem("testpolicy"));
} catch (VaultConnectorException e) { } catch (VaultConnectorException e) {
fail("Creation of role by name failed."); fail("Creation of role by name failed.");
} }
@ -1079,7 +1079,7 @@ public class HTTPVaultConnectorTest {
assertThat("Root token should not be renewable", res.getAuth().isRenewable(), is(false)); assertThat("Root token should not be renewable", res.getAuth().isRenewable(), is(false));
assertThat("Root token should not be orphan", res.getAuth().isOrphan(), is(false)); assertThat("Root token should not be orphan", res.getAuth().isOrphan(), is(false));
// Starting with Vault 1.0 a warning "cusotm ID uses weaker SHA1..." is given. // Starting with Vault 1.0 a warning "custom ID uses weaker SHA1..." is given.
if (VAULT_VERSION.startsWith("1.")) { if (VAULT_VERSION.startsWith("1.")) {
assertThat("Token creation did not return expected warning.", res.getWarnings(), hasSize(1)); assertThat("Token creation did not return expected warning.", res.getWarnings(), hasSize(1));
} else { } else {
@ -1106,7 +1106,7 @@ public class HTTPVaultConnectorTest {
assertThat("Metadata not correct.", res.getAuth().getMetadata().get("foo"), is("bar")); assertThat("Metadata not correct.", res.getAuth().getMetadata().get("foo"), is("bar"));
assertThat("Token should be renewable", res.getAuth().isRenewable(), is(true)); assertThat("Token should be renewable", res.getAuth().isRenewable(), is(true));
} catch (VaultConnectorException e) { } catch (VaultConnectorException e) {
fail("Token createion failed: " + e.getMessage()); fail("Token creation failed: " + e.getMessage());
} }
/* Overwrite token should fail as of Vault 0.8.0 */ /* Overwrite token should fail as of Vault 0.8.0 */
@ -1146,12 +1146,12 @@ public class HTTPVaultConnectorTest {
assertThat("Specified token Type not set", res.getAuth().getTokenType(), is(Token.Type.BATCH.value())); assertThat("Specified token Type not set", res.getAuth().getTokenType(), is(Token.Type.BATCH.value()));
} catch (VaultConnectorException e) { } catch (VaultConnectorException e) {
fail("Token createion failed: " + e.getMessage()); fail("Token creation failed: " + e.getMessage());
} }
} }
/** /**
* Test token lookuo. * Test token lookup.
*/ */
@Test @Test
@Order(30) @Order(30)
@ -1268,8 +1268,8 @@ public class HTTPVaultConnectorTest {
fail("Token role deletion failed."); fail("Token role deletion failed.");
} }
assertThrows(InvalidResponseException.class, () -> connector.readTokenRole(roleName), "Reading inexistent token role should fail"); assertThrows(InvalidResponseException.class, () -> connector.readTokenRole(roleName), "Reading nonexistent token role should fail");
assertThrows(InvalidResponseException.class, () -> connector.listTokenRoles(), "Listing inexistent token roles should fail"); assertThrows(InvalidResponseException.class, () -> connector.listTokenRoles(), "Listing nonexistent token roles should fail");
} }
} }
@ -1405,7 +1405,7 @@ public class HTTPVaultConnectorTest {
try { try {
connector.seal(); connector.seal();
assumeTrue(connector.sealStatus().isSealed()); assumeTrue(connector.sealStatus().isSealed());
connector.resetAuth(); // SHould work unauthenticated connector.resetAuth(); // Should work unauthenticated
} catch (VaultConnectorException e) { } catch (VaultConnectorException e) {
fail("Unexpected exception on sealing: " + e.getMessage()); fail("Unexpected exception on sealing: " + e.getMessage());
} }

View File

@ -86,7 +86,7 @@ public class TokenBuilderTest {
* Build token without any parameters. * Build token without any parameters.
*/ */
@Test @Test
public void legadcyBuildDefaultTest() throws JsonProcessingException { public void legacyBuildDefaultTest() throws JsonProcessingException {
Token token = new TokenBuilder().build(); Token token = new TokenBuilder().build();
assertThat(token.getId(), is(nullValue())); assertThat(token.getId(), is(nullValue()));
assertThat(token.getType(), is(nullValue())); assertThat(token.getType(), is(nullValue()));

View File

@ -77,7 +77,7 @@ public class MetadataResponseTest {
try { try {
MetadataResponse res = new ObjectMapper().readValue(META_JSON, MetadataResponse.class); MetadataResponse res = new ObjectMapper().readValue(META_JSON, MetadataResponse.class);
assertThat("Parsed response is NULL", res, is(notNullValue())); assertThat("Parsed response is NULL", res, is(notNullValue()));
assertThat("Parsed metadatra is NULL", res.getMetadata(), is(notNullValue())); assertThat("Parsed metadata is NULL", res.getMetadata(), is(notNullValue()));
assertThat("Incorrect created time", res.getMetadata().getCreatedTimeString(), is(V1_TIME)); assertThat("Incorrect created time", res.getMetadata().getCreatedTimeString(), is(V1_TIME));
assertThat("Parting created time failed", res.getMetadata().getCreatedTime(), is(notNullValue())); assertThat("Parting created time failed", res.getMetadata().getCreatedTime(), is(notNullValue()));
assertThat("Incorrect current version", res.getMetadata().getCurrentVersion(), is(CURRENT_VERSION)); assertThat("Incorrect current version", res.getMetadata().getCurrentVersion(), is(CURRENT_VERSION));
@ -87,14 +87,14 @@ public class MetadataResponseTest {
assertThat("Parting updated time failed", res.getMetadata().getUpdatedTime(), is(notNullValue())); assertThat("Parting updated time failed", res.getMetadata().getUpdatedTime(), is(notNullValue()));
assertThat("Incorrect number of versions", res.getMetadata().getVersions().size(), is(3)); assertThat("Incorrect number of versions", res.getMetadata().getVersions().size(), is(3));
assertThat("Incorrect version 1 delete time", res.getMetadata().getVersions().get(1).getDeletionTimeString(), is(V2_TIME)); assertThat("Incorrect version 1 delete time", res.getMetadata().getVersions().get(1).getDeletionTimeString(), is(V2_TIME));
assertThat("Parsion version delete time failed", res.getMetadata().getVersions().get(1).getDeletionTime(), is(notNullValue())); assertThat("Parsing version delete time failed", res.getMetadata().getVersions().get(1).getDeletionTime(), is(notNullValue()));
assertThat("Incorrect version 1 destroyed state", res.getMetadata().getVersions().get(1).isDestroyed(), is(true)); assertThat("Incorrect version 1 destroyed state", res.getMetadata().getVersions().get(1).isDestroyed(), is(true));
assertThat("Incorrect version 2 created time", res.getMetadata().getVersions().get(2).getCreatedTimeString(), is(V2_TIME)); assertThat("Incorrect version 2 created time", res.getMetadata().getVersions().get(2).getCreatedTimeString(), is(V2_TIME));
assertThat("Parsion version created failed", res.getMetadata().getVersions().get(2).getCreatedTime(), is(notNullValue())); assertThat("Parsing version created failed", res.getMetadata().getVersions().get(2).getCreatedTime(), is(notNullValue()));
assertThat("Incorrect version 3 destroyed state", res.getMetadata().getVersions().get(3).isDestroyed(), is(false)); assertThat("Incorrect version 3 destroyed state", res.getMetadata().getVersions().get(3).isDestroyed(), is(false));
} catch (IOException e) { } catch (IOException e) {
fail("MetadataResoponse deserialization failed: " + e.getMessage()); fail("MetadataResponse deserialization failed: " + e.getMessage());
} }
} }
} }

View File

@ -54,7 +54,7 @@ public class SecretVersionResponseTest {
try { try {
SecretVersionResponse res = new ObjectMapper().readValue(META_JSON, SecretVersionResponse.class); SecretVersionResponse res = new ObjectMapper().readValue(META_JSON, SecretVersionResponse.class);
assertThat("Parsed response is NULL", res, is(notNullValue())); assertThat("Parsed response is NULL", res, is(notNullValue()));
assertThat("Parsed metadatra is NULL", res.getMetadata(), is(notNullValue())); assertThat("Parsed metadata is NULL", res.getMetadata(), is(notNullValue()));
assertThat("Incorrect created time", res.getMetadata().getCreatedTimeString(), is(CREATION_TIME)); assertThat("Incorrect created time", res.getMetadata().getCreatedTimeString(), is(CREATION_TIME));
assertThat("Incorrect deletion time", res.getMetadata().getDeletionTimeString(), is(DELETION_TIME)); assertThat("Incorrect deletion time", res.getMetadata().getDeletionTimeString(), is(DELETION_TIME));
assertThat("Incorrect destroyed state", res.getMetadata().isDestroyed(), is(false)); assertThat("Incorrect destroyed state", res.getMetadata().isDestroyed(), is(false));