Published fragment PartialEqual
, on a custom Go assertion helper that we’ve been using for a few months now to good effect:
resp, err := apitest.InvokeHandler(svc.Create, ctx, req)
require.NoError(t, err)
prequire.PartialEqual(t, &apiresourcekind.Cluster{
Environment: ptrutil.Ptr(dbsqlc.EnvironmentProduction),
IsHA: ptrutil.Ptr(req.IsHA),
MajorVersion: req.PostgresVersionID.Int32,
PlanID: req.PlanID,
RegionID: req.RegionID,
Storage: req.Storage,
TeamID: req.TeamID,
}, resp)