рабочий вариант, но скороть 10 МБит
This commit is contained in:
@@ -14,7 +14,7 @@ func TestAdminRuntimeDispatcherReturnsHealthAndManifest(t *testing.T) {
|
||||
Method: http.MethodGet,
|
||||
Path: "/readyz",
|
||||
Scope: "platform",
|
||||
ServiceClass: "platform_admin",
|
||||
ServiceClass: "admin-ingress",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("health: %v", err)
|
||||
@@ -25,9 +25,9 @@ func TestAdminRuntimeDispatcherReturnsHealthAndManifest(t *testing.T) {
|
||||
|
||||
manifest, err := dispatcher.HandleFabricRequest(context.Background(), FabricRequest{
|
||||
Method: http.MethodGet,
|
||||
Path: "/platform-admin/ui-manifest",
|
||||
Path: "/admin/ui-manifest",
|
||||
Scope: "platform",
|
||||
ServiceClass: "platform_admin",
|
||||
ServiceClass: "admin-ingress",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("manifest: %v", err)
|
||||
@@ -51,9 +51,9 @@ func TestAdminRuntimeDispatcherBlocksMutationsAndUnknownProjection(t *testing.T)
|
||||
|
||||
mutation, err := dispatcher.HandleFabricRequest(context.Background(), FabricRequest{
|
||||
Method: http.MethodPost,
|
||||
Path: "/platform-admin/nodes",
|
||||
Path: "/admin/nodes",
|
||||
Scope: "platform",
|
||||
ServiceClass: "platform_admin",
|
||||
ServiceClass: "admin-ingress",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("mutation: %v", err)
|
||||
@@ -68,9 +68,9 @@ func TestAdminRuntimeDispatcherBlocksMutationsAndUnknownProjection(t *testing.T)
|
||||
|
||||
projection, err := dispatcher.HandleFabricRequest(context.Background(), FabricRequest{
|
||||
Method: http.MethodGet,
|
||||
Path: "/platform-admin/nodes",
|
||||
Path: "/admin/nodes",
|
||||
Scope: "platform",
|
||||
ServiceClass: "platform_admin",
|
||||
ServiceClass: "admin-ingress",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("projection: %v", err)
|
||||
@@ -88,9 +88,9 @@ func TestAdminRuntimeDispatcherRejectsInvalidScopeClassPair(t *testing.T) {
|
||||
dispatcher := AdminRuntimeDispatcher{ProjectionClient: &recordingProjectionClient{}, Now: fixedEnvelopeNow}
|
||||
response, err := dispatcher.HandleFabricRequest(context.Background(), FabricRequest{
|
||||
Method: http.MethodGet,
|
||||
Path: "/platform-admin/ui-manifest",
|
||||
Path: "/admin/ui-manifest",
|
||||
Scope: "organization",
|
||||
ServiceClass: "platform_admin",
|
||||
ServiceClass: "admin-ingress",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("projection: %v", err)
|
||||
@@ -118,11 +118,11 @@ func TestAdminRuntimeDispatcherUsesControlAPIProjectionClientForReadRequests(t *
|
||||
|
||||
response, err := dispatcher.HandleFabricRequest(context.Background(), FabricRequest{
|
||||
Method: http.MethodGet,
|
||||
Path: "/platform-admin/nodes",
|
||||
Path: "/admin/nodes",
|
||||
Query: "limit=10",
|
||||
Host: "admin.example.test",
|
||||
Scope: "platform",
|
||||
ServiceClass: "platform_admin",
|
||||
ServiceClass: "admin-ingress",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("projection: %v", err)
|
||||
@@ -133,10 +133,10 @@ func TestAdminRuntimeDispatcherUsesControlAPIProjectionClientForReadRequests(t *
|
||||
string(response.Body) != `{"schema_version":"control.projection.v1","ok":true}` {
|
||||
t.Fatalf("response = %+v body=%s", response, string(response.Body))
|
||||
}
|
||||
if client.request.Path != "/platform-admin/nodes" ||
|
||||
if client.request.Path != "/admin/nodes" ||
|
||||
client.request.Query != "limit=10" ||
|
||||
client.request.Scope != "platform" ||
|
||||
client.request.ServiceClass != "platform_admin" {
|
||||
client.request.ServiceClass != "admin-ingress" {
|
||||
t.Fatalf("request = %+v", client.request)
|
||||
}
|
||||
}
|
||||
@@ -145,9 +145,9 @@ func TestAdminRuntimeDispatcherReportsProjectionClientFailure(t *testing.T) {
|
||||
dispatcher := AdminRuntimeDispatcher{ProjectionClient: failingProjectionClient{}, Now: fixedEnvelopeNow}
|
||||
response, err := dispatcher.HandleFabricRequest(context.Background(), FabricRequest{
|
||||
Method: http.MethodGet,
|
||||
Path: "/platform-admin/nodes",
|
||||
Path: "/admin/nodes",
|
||||
Scope: "platform",
|
||||
ServiceClass: "platform_admin",
|
||||
ServiceClass: "admin-ingress",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("projection: %v", err)
|
||||
@@ -175,9 +175,9 @@ func TestAdminRuntimeDispatcherRejectsInvalidProjectionResponseSchema(t *testing
|
||||
}
|
||||
response, err := dispatcher.HandleFabricRequest(context.Background(), FabricRequest{
|
||||
Method: http.MethodGet,
|
||||
Path: "/platform-admin/nodes",
|
||||
Path: "/admin/nodes",
|
||||
Scope: "platform",
|
||||
ServiceClass: "platform_admin",
|
||||
ServiceClass: "admin-ingress",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("projection: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user