diff --git a/wrapper/localsuite/creator_test.go b/wrapper/localsuite/creator_test.go index 455c27f..1238db5 100644 --- a/wrapper/localsuite/creator_test.go +++ b/wrapper/localsuite/creator_test.go @@ -17,13 +17,15 @@ import ( kmsapi "github.com/trustbloc/kms-go/spi/kms" ) +const ( + keyID = "foo" +) + func TestKeyCreator(t *testing.T) { t.Run("success", func(t *testing.T) { keyBytes, _, err := ed25519.GenerateKey(rand.Reader) require.NoError(t, err) - keyID := "foo" - creator := newKeyCreator(&mockkms.KeyManager{ CrAndExportPubKeyValue: keyBytes, CrAndExportPubKeyID: keyID, @@ -45,8 +47,6 @@ func TestKeyCreator(t *testing.T) { keyBytes, _, err := ed25519.GenerateKey(rand.Reader) require.NoError(t, err) - keyID := "foo" - creator := newKeyCreator(&mockkms.KeyManager{ ExportPubKeyTypeValue: kmsapi.ED25519Type, ExportPubKeyBytesValue: keyBytes, @@ -77,7 +77,7 @@ func TestKeyCreator(t *testing.T) { t.Run("kms exports invalid key value", func(t *testing.T) { creator := newKeyCreator(&mockkms.KeyManager{ - CrAndExportPubKeyValue: []byte("foo"), + CrAndExportPubKeyValue: []byte(keyID), }) pubJWK, err := creator.Create(kmsapi.ECDSAP256DER)