Added Test cases for the module

- Code coverage for Module is 93.1%
This commit is contained in:
MohitKatare-protean
2025-03-26 11:54:27 +05:30
parent ec558558c5
commit ff680dacbb
3 changed files with 169 additions and 4 deletions

View File

@@ -44,8 +44,8 @@ const (
HandlerTypeLookup Type = "lookUp"
)
// pluginCfg holds the configuration for various plugins.
type pluginCfg struct {
// PluginCfg holds the configuration for various plugins.
type PluginCfg struct {
SchemaValidator *plugin.Config `yaml:"schemaValidator,omitempty"`
SignValidator *plugin.Config `yaml:"signValidator,omitempty"`
Publisher *plugin.Config `yaml:"publisher,omitempty"`
@@ -59,7 +59,7 @@ type pluginCfg struct {
// Config holds the configuration for request processing handlers.
type Config struct {
Plugins pluginCfg `yaml:"plugins"`
Plugins PluginCfg `yaml:"plugins"`
Steps []string
Type Type
RegistryURL string `yaml:"registryUrl"`

View File

@@ -189,7 +189,7 @@ func loadKeyManager(ctx context.Context, mgr PluginManager, cache definition.Cac
}
// initPlugins initializes required plugins for the processor.
func (h *stdHandler) initPlugins(ctx context.Context, mgr PluginManager, cfg *pluginCfg, regURL string) error {
func (h *stdHandler) initPlugins(ctx context.Context, mgr PluginManager, cfg *PluginCfg, regURL string) error {
var err error
if h.cache, err = loadPlugin(ctx, "Cache", cfg.Cache, mgr.Cache); err != nil {
return err