You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2023/04/04 15:27:44 UTC
[camel-k] branch main updated: chore/keystore_test file path change
This is an automated email from the ASF dual-hosted git repository.
pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/main by this push:
new acf284ab7 chore/keystore_test file path change
acf284ab7 is described below
commit acf284ab7fa270f90cfd996f55530d81c135f3ff
Author: Martin Olsiak <ma...@gmail.com>
AuthorDate: Tue Apr 4 13:34:54 2023 +0200
chore/keystore_test file path change
---
pkg/util/jvm/keystore_test.go | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/pkg/util/jvm/keystore_test.go b/pkg/util/jvm/keystore_test.go
index 3859d79bc..0b570ae84 100644
--- a/pkg/util/jvm/keystore_test.go
+++ b/pkg/util/jvm/keystore_test.go
@@ -19,8 +19,10 @@ package jvm
import (
"context"
+ "os"
"testing"
+ "github.com/apache/camel-k/v2/pkg/util"
"github.com/stretchr/testify/assert"
)
@@ -29,15 +31,20 @@ func TestGenerateKeystore(t *testing.T) {
// No Data
var data [][]byte
ctx := context.Background()
- err := GenerateKeystore(ctx, "", "name", NewKeystorePassword(), data)
+ err := GenerateKeystore(ctx, "", "/tmp/keystore", NewKeystorePassword(), data)
assert.Nil(t, err)
// Correct input
data = [][]byte{{0}, {1}}
- err = GenerateKeystore(ctx, "", "name", NewKeystorePassword(), data)
+ err = GenerateKeystore(ctx, "", "/tmp/keystore", NewKeystorePassword(), data)
assert.NotNil(t, err)
// Incorrect input format
- err = GenerateKeystore(ctx, "", "name", "", data)
+ err = GenerateKeystore(ctx, "", "/tmp/keystore", "", data)
assert.NotNil(t, err)
+
+ testFileExists, _ := util.FileExists("/tmp/keystore")
+ if testFileExists {
+ os.Remove("/tmp/keystore")
+ }
}