Skip to content

Commit

Permalink
Remove unnecessary encryptor test
Browse files Browse the repository at this point in the history
  • Loading branch information
islamaliev committed Aug 19, 2024
1 parent a01faa1 commit e19cd2b
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions internal/encryption/encryptor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,6 @@ func TestEncryptorEncrypt_IfStorageReturnsError_Error(t *testing.T) {
assert.ErrorIs(t, err, testErr)
}

func TestEncryptorEncrypt_WithEmptyFieldNameIfNoKeyFoundInStorage_ShouldGenerateKeyStoreItAndReturnCipherText(t *testing.T) {
enc, st := newDefaultEncryptor(t)

storeKey := makeStoreKey(docID, noFieldName)

st.EXPECT().Put(mock.Anything, storeKey.ToDS(), getEncKey(noFieldName)).Return(nil)

_, _, err := enc.GetOrGenerateEncryptionKey(docID, noFieldName)
assert.NoError(t, err)

cipherText, err := enc.Encrypt(makeStoreKey(docID, noFieldName), getPlainText())

assert.NoError(t, err)
assert.Equal(t, getCipherText(t, noFieldName), cipherText)
}

func TestEncryptorEncrypt_IfKeyWithFieldFoundInStorage_ShouldUseItToReturnCipherText(t *testing.T) {
enc, st := newEncryptorWithConfig(t, DocEncConfig{EncryptedFields: []string{fieldName.Value()}})

Expand Down

0 comments on commit e19cd2b

Please sign in to comment.