mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-04-13 11:50:43 +02:00
This reverts commit 8205624a22920f2ebe1e7999bf1b384aeae04e5d. Co-authored-by: Valentin Uchkunev <valentin.uchkunev@sap.com>
22 lines
417 B
Go
22 lines
417 B
Go
package cmd
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestCpeEncryption(t *testing.T) {
|
|
secret := []byte("testKey!")
|
|
payload := []byte(strings.Repeat("testString", 100))
|
|
|
|
encrypted, err := encrypt(secret, payload)
|
|
assert.NoError(t, err)
|
|
assert.NotNil(t, encrypted)
|
|
|
|
decrypted, err := decrypt(secret, encrypted)
|
|
assert.NoError(t, err)
|
|
assert.Equal(t, decrypted, payload)
|
|
}
|