From 2b850f8bb7bac5f147fcf910f3e923876feb0ad4 Mon Sep 17 00:00:00 2001 From: rupinder-syngh Date: Tue, 8 Apr 2025 15:40:14 +0530 Subject: [PATCH] fix: test cases enhancement --- pkg/plugin/manager_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pkg/plugin/manager_test.go b/pkg/plugin/manager_test.go index 4ae43d8..1c47fc1 100644 --- a/pkg/plugin/manager_test.go +++ b/pkg/plugin/manager_test.go @@ -895,6 +895,10 @@ func TestCacheSuccess(t *testing.T) { t.Error("expected non-nil cache, got nil") } + if cache != tt.plugin.cache { + t.Error("cache does not match expected instance") + } + if len(m.closers) != 1 { t.Errorf("Manager.closers has %d closers, expected 1", len(m.closers)) } @@ -1008,6 +1012,10 @@ func TestSignerSuccess(t *testing.T) { t.Error("expected non-nil signer, got nil") } + if signer != tt.plugin.signer { + t.Error("signer does not match expected instance") + } + if len(m.closers) != 1 { t.Errorf("Manager.closers has %d closers, expected 1", len(m.closers)) } @@ -1121,6 +1129,10 @@ func TestEncryptorSuccess(t *testing.T) { t.Error("expected non-nil encrypter, got nil") } + if encrypter != tt.plugin.encrypter { + t.Error("encrypter does not match expected instance") + } + if len(m.closers) != 1 { t.Errorf("Manager.closers has %d closers, expected 1", len(m.closers)) } @@ -1234,6 +1246,10 @@ func TestDecryptorSuccess(t *testing.T) { t.Error("expected non-nil decrypter, got nil") } + if decrypter != tt.plugin.decrypter { + t.Error("decrypter does not match expected instance") + } + if len(m.closers) != 1 { t.Errorf("Manager.closers has %d closers, expected 1", len(m.closers)) } @@ -1467,6 +1483,10 @@ func TestKeyManagerSuccess(t *testing.T) { t.Error("expected non-nil key manager, got nil") } + if keyManager != tt.plugin.keyManager { + t.Error("key manager does not match expected instance") + } + if len(m.closers) != 1 { t.Errorf("Manager.closers has %d closers, expected 1", len(m.closers)) }