1
0
mirror of https://github.com/getsops/sops.git synced 2026-02-05 12:45:21 +01:00

kms: add minimal test for NewMasterKeyWithProfile

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
This commit is contained in:
Hidde Beydals
2023-10-13 16:14:07 +02:00
parent 75137322d5
commit 6887ebfb19

View File

@@ -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 (