From 2a4a6720617f3ca4c89ad732560ee6900cf75b74 Mon Sep 17 00:00:00 2001 From: Charles Lee Date: Thu, 1 Feb 2024 14:41:00 -0800 Subject: [PATCH] Fix an order dependent test by registering a fakekms client. PiperOrigin-RevId: 603486600 Change-Id: Iaacaaefdd56075fa0a0ee1314d3311b2125f586e --- aead/kms_envelope_aead_key_manager_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aead/kms_envelope_aead_key_manager_test.go b/aead/kms_envelope_aead_key_manager_test.go index 1164016..848afc8 100644 --- a/aead/kms_envelope_aead_key_manager_test.go +++ b/aead/kms_envelope_aead_key_manager_test.go @@ -21,6 +21,7 @@ import ( "google.golang.org/protobuf/proto" "github.com/tink-crypto/tink-go/v2/aead" + "github.com/tink-crypto/tink-go/v2/core/registry" "github.com/tink-crypto/tink-go/v2/keyset" "github.com/tink-crypto/tink-go/v2/mac" "github.com/tink-crypto/tink-go/v2/testing/fakekms" @@ -64,6 +65,12 @@ func TestNewKMSEnvelopeAEADKeyWithInvalidSerializedKeyFormat(t *testing.T) { if err != nil { t.Fatalf("fakekms.NewKeyURI() err = %v", err) } + fakeClient, err := fakekms.NewClient(keyURI) + if err != nil { + t.Fatalf("fakekms.NewClient() err = %v", err) + } + registry.RegisterKMSClient(fakeClient) + defer registry.ClearKMSClients() // Create DEK template with unset embedded key parameters. dekFormat := &ctrhmacpb.AesCtrHmacAeadKeyFormat{