Chore: Replace appcontext.User(ctx) with identity.GetRequester(ctx) (#91030)
This commit is contained in:
@@ -4,11 +4,11 @@ import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/grafana/grafana/pkg/apimachinery/identity"
|
||||
"github.com/grafana/grafana/pkg/infra/tracing"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/grafana/grafana/pkg/components/satokengen"
|
||||
"github.com/grafana/grafana/pkg/infra/appcontext"
|
||||
"github.com/grafana/grafana/pkg/server"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
"github.com/grafana/grafana/pkg/services/org"
|
||||
@@ -99,6 +99,6 @@ func createTestContext(t *testing.T) testContext {
|
||||
authToken: authToken,
|
||||
client: client,
|
||||
user: serviceAccountUser,
|
||||
ctx: appcontext.WithUser(context.Background(), serviceAccountUser),
|
||||
ctx: identity.WithRequester(context.Background(), serviceAccountUser),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/appcontext"
|
||||
"github.com/grafana/grafana/pkg/apimachinery/identity"
|
||||
"github.com/grafana/grafana/pkg/services/store/entity"
|
||||
)
|
||||
|
||||
@@ -119,7 +119,7 @@ func TestIntegrationEntityServer(t *testing.T) {
|
||||
}
|
||||
|
||||
testCtx := createTestContext(t)
|
||||
ctx := appcontext.WithUser(testCtx.ctx, testCtx.user)
|
||||
ctx := identity.WithRequester(testCtx.ctx, testCtx.user)
|
||||
|
||||
fakeUser := testCtx.user.GetUID().String()
|
||||
firstVersion := int64(0)
|
||||
|
||||
Reference in New Issue
Block a user