update the as per the comment
This commit is contained in:
@@ -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 plugin’s own HTTP server; just ensure provider is initialized.
|
||||
require.NotNil(t, provider.MeterProvider)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user