From 6887ebfb193fcb7bb2b2a2628bf95803cf5f5dc1 Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Fri, 13 Oct 2023 16:14:07 +0200 Subject: [PATCH] kms: add minimal test for `NewMasterKeyWithProfile` Signed-off-by: Hidde Beydals --- kms/keysource_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/kms/keysource_test.go b/kms/keysource_test.go index 4bed28621..855a1f880 100644 --- a/kms/keysource_test.go +++ b/kms/keysource_test.go @@ -122,6 +122,22 @@ func TestNewMasterKey(t *testing.T) { assert.NotNil(t, key.CreationDate) } +func TestNewMasterKeyWithProfile(t *testing.T) { + var ( + dummyRole = "a-role" + dummyEncryptionContext = map[string]*string{ + "foo": aws.String("bar"), + } + dummyProfile = "a-profile" + ) + key := NewMasterKeyWithProfile(dummyARN, dummyRole, dummyEncryptionContext, dummyProfile) + assert.Equal(t, dummyARN, key.Arn) + assert.Equal(t, dummyRole, key.Role) + assert.Equal(t, dummyEncryptionContext, key.EncryptionContext) + assert.Equal(t, dummyProfile, key.AwsProfile) + assert.NotNil(t, key.CreationDate) +} + func TestNewMasterKeyFromArn(t *testing.T) { t.Run("arn", func(t *testing.T) { var (