| 114 | } |
| 115 | |
| 116 | func TestMasterKey_ToMap(t *testing.T) { |
| 117 | key := MasterKey{ |
| 118 | credentialJSON: []byte("sensitive creds"), |
| 119 | CreationDate: time.Date(2016, time.October, 31, 10, 0, 0, 0, time.UTC), |
| 120 | ResourceID: testResourceID, |
| 121 | EncryptedKey: "this is encrypted", |
| 122 | } |
| 123 | assert.Equal(t, map[string]interface{}{ |
| 124 | "resource_id": testResourceID, |
| 125 | "enc": "this is encrypted", |
| 126 | "created_at": "2016-10-31T10:00:00Z", |
| 127 | }, key.ToMap()) |
| 128 | } |
| 129 | |
| 130 | func TestMasterKey_createCloudKMSService_withCredentialsFile(t *testing.T) { |
| 131 | tests := []struct { |