Merge pull request #614 from ssd532/fix/test-failures
Fix test failures in reqmapper and simplekeymanager plugins
This commit is contained in:
@@ -11,7 +11,8 @@ import (
|
||||
|
||||
func TestProviderNewSuccess(t *testing.T) {
|
||||
p := provider{}
|
||||
middleware, err := p.New(context.Background(), map[string]string{"role": "bap"})
|
||||
mappingFile := "../testdata/mappings.yaml"
|
||||
middleware, err := p.New(context.Background(), map[string]string{"role": "bap", "mappingsFile": mappingFile})
|
||||
if err != nil {
|
||||
t.Fatalf("provider.New returned unexpected error: %v", err)
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ func TestSimpleKeyManagerProvider_New(t *testing.T) {
|
||||
config: map[string]string{
|
||||
"keyId": "test-key",
|
||||
},
|
||||
wantErr: false,
|
||||
wantErr: true,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -145,14 +145,13 @@ func TestConfigMapping(t *testing.T) {
|
||||
cache := &mockCache{}
|
||||
registry := &mockRegistry{}
|
||||
|
||||
// Test config mapping
|
||||
configMap := map[string]string{
|
||||
"networkParticipant": "mapped-np",
|
||||
"keyId": "mapped-key-id",
|
||||
"signingPrivateKey": "mapped-signing-private",
|
||||
"signingPublicKey": "mapped-signing-public",
|
||||
"encrPrivateKey": "mapped-encr-private",
|
||||
"encrPublicKey": "mapped-encr-public",
|
||||
"signingPrivateKey": "dGVzdC1zaWduaW5nLXByaXZhdGU=",
|
||||
"signingPublicKey": "dGVzdC1zaWduaW5nLXB1YmxpYw==",
|
||||
"encrPrivateKey": "dGVzdC1lbmNyLXByaXZhdGU=",
|
||||
"encrPublicKey": "dGVzdC1lbmNyLXB1YmxpYw==",
|
||||
}
|
||||
|
||||
// We can't directly test the config mapping without exposing internals,
|
||||
|
||||
@@ -181,10 +181,6 @@ func TestGenerateKeyset(t *testing.T) {
|
||||
return
|
||||
}
|
||||
|
||||
// Check that all fields are populated
|
||||
if keyset.SubscriberID == "" {
|
||||
t.Error("GenerateKeyset() SubscriberID is empty")
|
||||
}
|
||||
if keyset.UniqueKeyID == "" {
|
||||
t.Error("GenerateKeyset() UniqueKeyID is empty")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user