fix: module id and linting issues
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/beckn/beckn-onix/core/module/handler"
|
||||
"github.com/beckn/beckn-onix/pkg/model"
|
||||
"github.com/beckn/beckn-onix/pkg/plugin"
|
||||
"github.com/beckn/beckn-onix/pkg/plugin/definition"
|
||||
)
|
||||
@@ -106,7 +107,7 @@ func TestRegisterSuccess(t *testing.T) {
|
||||
// Create a handler that extracts context
|
||||
var capturedModuleName any
|
||||
testHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
capturedModuleName = r.Context().Value("module_name")
|
||||
capturedModuleName = r.Context().Value(model.ContextKeyModuleId)
|
||||
w.WriteHeader(http.StatusOK)
|
||||
})
|
||||
|
||||
@@ -115,7 +116,7 @@ func TestRegisterSuccess(t *testing.T) {
|
||||
|
||||
// Now verify if module name exists in context
|
||||
if capturedModuleName != "test-module" {
|
||||
t.Errorf("expected module_name in context to be 'test-module', got %v", capturedModuleName)
|
||||
t.Errorf("expected module_id in context to be 'test-module', got %v", capturedModuleName)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user