1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00
sap-jenkins-library/cmd/readPipelineEnv_test.go

21 lines
416 B
Go
Raw Normal View History

package cmd
import (
"github.com/stretchr/testify/assert"
"strings"
"testing"
)
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)
}