(t *testing.T)
| 350 | } |
| 351 | |
| 352 | func TestMasterKey_EncryptDecrypt_RoundTrip(t *testing.T) { |
| 353 | dataKey := []byte("the wheels on the bus go round and round") |
| 354 | |
| 355 | encryptKey := createTestMasterKey(testKMSARN) |
| 356 | assert.NoError(t, encryptKey.Encrypt(dataKey)) |
| 357 | assert.NotEmpty(t, encryptKey.EncryptedKey) |
| 358 | |
| 359 | decryptKey := createTestMasterKey(testKMSARN) |
| 360 | decryptKey.EncryptedKey = encryptKey.EncryptedKey |
| 361 | |
| 362 | decryptedData, err := decryptKey.Decrypt() |
| 363 | assert.NoError(t, err) |
| 364 | assert.Equal(t, dataKey, decryptedData) |
| 365 | } |
| 366 | |
| 367 | func TestMasterKey_NeedsRotation(t *testing.T) { |
| 368 | key := NewMasterKeyFromArn(dummyARN, nil, "") |
nothing calls this directly
no test coverage detected