Search in sources :

Example 31 with Secret

use of com.google.cloud.secretmanager.v1beta1.Secret in project yakc by manusa.

the class SecretIT method readNamespacedSecret.

@Test
@DisplayName("readNamespacedSecret, should read newly created Secret")
void readNamespacedSecret() throws IOException {
    // When
    final Secret secretFromServer = KC.create(CoreV1Api.class).readNamespacedSecret(secretName, NAMESPACE).get();
    // Then
    assertThat(secretFromServer).isNotNull().hasFieldOrPropertyWithValue("metadata.name", secretName).extracting(Secret::getData).asInstanceOf(InstanceOfAssertFactories.MAP).hasSize(3).containsEntry("FOO", "QkFS");
}
Also used : Secret(com.marcnuri.yakc.model.io.k8s.api.core.v1.Secret) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Aggregations

Secret (com.google.cloud.secretmanager.v1.Secret)21 ProjectName (com.google.cloud.secretmanager.v1.ProjectName)11 SecretManagerServiceClient (com.google.cloud.secretmanager.v1.SecretManagerServiceClient)11 Test (org.junit.Test)6 SecretName (com.google.cloud.secretmanager.v1.SecretName)5 ByteString (com.google.protobuf.ByteString)5 CreateSecretRequest (com.google.cloud.secretmanager.v1.CreateSecretRequest)4 Secret (com.google.cloud.secretmanager.v1beta1.Secret)3 AbstractMessage (com.google.protobuf.AbstractMessage)3 FieldMask (com.google.protobuf.FieldMask)3 Secret (com.marcnuri.yakc.model.io.k8s.api.core.v1.Secret)3 Test (org.junit.jupiter.api.Test)3 AccessSecretVersionResponse (com.google.cloud.secretmanager.v1.AccessSecretVersionResponse)2 ListSecretsRequest (com.google.cloud.secretmanager.v1.ListSecretsRequest)2 ListSecretsPagedResponse (com.google.cloud.secretmanager.v1.SecretManagerServiceClient.ListSecretsPagedResponse)2 SecretPayload (com.google.cloud.secretmanager.v1.SecretPayload)2 SecretVersion (com.google.cloud.secretmanager.v1.SecretVersion)2 ListSecretsPagedResponse (com.google.cloud.secretmanager.v1beta1.SecretManagerServiceClient.ListSecretsPagedResponse)2 Configuration (com.marcnuri.yakc.config.Configuration)2 Node (com.marcnuri.yakc.model.io.k8s.api.core.v1.Node)2