Files
go-cart-actor/cmd/checkout/cart-client_test.go
T
mats 11be8aec56
Build and Publish / BuildAndDeployArm64 (push) Failing after 1m8s
Build and Publish / BuildAndDeployAmd64 (push) Has been cancelled
name
2026-06-17 00:09:30 +02:00

32 lines
857 B
Go

package main
import (
"context"
"testing"
"git.k6n.net/mats/go-cart-actor/pkg/cart"
)
// TestGetCartGrain_RealService tests against the actual service at https://cart.k6n.net/
// This test is skipped by default and can be run with: go test -run TestGetCartGrain_RealService
func TestGetCartGrain_RealService(t *testing.T) {
t.Skip("Skipping integration test against real service")
client := NewCartClient("https://cart.k6n.net")
// You would need a real cart ID that exists in the system
// For example: cartId := cart.NewCartId(123, 456)
cartId := cart.MustParseCartId("JkfG6bRNLMy")
grain, err := client.getCartGrain(context.Background(), cartId)
if err != nil {
t.Fatalf("Failed to get cart grain: %v", err)
}
if grain == nil {
t.Fatal("Expected grain to be non-nil")
}
t.Logf("Successfully retrieved cart grain: %+v", grain)
}