update the as per the comment

This commit is contained in:
Manendra Pal Singh
2025-12-15 12:12:33 +05:30
parent c367a970d1
commit 17d9ca865d
8 changed files with 96 additions and 81 deletions

View File

@@ -2,7 +2,6 @@ package main
import (
"context"
"net/http/httptest"
"testing"
"github.com/beckn-one/beckn-onix/pkg/plugin/implementation/otelsetup"
@@ -21,12 +20,6 @@ func TestMetricsEndpointExposesPrometheus(t *testing.T) {
require.NoError(t, err)
defer provider.Shutdown(context.Background())
rec := httptest.NewRecorder()
req := httptest.NewRequest("GET", "/metrics", nil)
provider.MetricsHandler.ServeHTTP(rec, req)
require.Equal(t, 200, rec.Code)
body := rec.Body.String()
require.Contains(t, body, "# HELP")
require.Contains(t, body, "# TYPE")
// Metrics are served by the plugins own HTTP server; just ensure provider is initialized.
require.NotNil(t, provider.MeterProvider)
}