Upstream sync

This commit is contained in:
Senad Uka
2023-09-18 12:27:40 +02:00
parent 9750aa2c37
commit 1f30f85787
30 changed files with 309 additions and 150 deletions

22
shared/encryption_test.go Normal file
View File

@@ -0,0 +1,22 @@
package shared
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestEncryptionClient(t *testing.T) {
client := encryptionClient{Secret: `abc&1*~#^2^#s0^=)^^7%b34`}
t.Run("encrypt/ decyrpt works", func(t *testing.T) {
text := "sample text to test encryption"
encodedText, err := client.Encrypt(text)
assert.NoError(t, err)
assert.NotEqual(t, text, encodedText)
decodedText, err := client.Decrypt(encodedText)
assert.NoError(t, err)
assert.Equal(t, text, decodedText)
})
}