Documentation
¶
Index ¶
- type Params
- type Seeder
- func (s *Seeder) EnsureAccount(ctx context.Context, t *testing.T) context.Context
- func (s *Seeder) EnsureApp(ctx context.Context, t *testing.T) *app.App
- func (s *Seeder) EnsureInstall(ctx context.Context, t *testing.T, appID string) *app.Install
- func (s *Seeder) EnsureOrg(ctx context.Context, t *testing.T) context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Params ¶
Params defines the dependencies required by the Seeder. This follows the FX dependency injection pattern used throughout ctl-api.
type Seeder ¶
type Seeder struct {
// contains filtered or unexported fields
}
Seeder provides helper methods for seeding test data in integration tests. It manages the creation of test fixtures with proper context management.
func New ¶
New creates a new Seeder instance with the given dependencies. This is called by FX during test setup.
func (*Seeder) EnsureAccount ¶
EnsureAccount creates a test account and sets it in the context. Returns the updated context with the account ID set.
The account is created with: - A unique fake subject ID - An email formatted as <subject>@test.nuon.co - Empty user journeys (no onboarding flow)
The returned context has the account ID set via cctx.SetAccountIDContext, which is required for most ctl-api operations.
func (*Seeder) EnsureApp ¶
EnsureApp creates a test app in the database. Returns a pointer to the created app.
The app is created with: - A unique fake name - A unique fake ID (26-character) - Associated with the org from context - Created by the account from context
The context must already have both org and account set via EnsureOrg and EnsureAccount.
func (*Seeder) EnsureInstall ¶
EnsureInstall creates a test install in the database. Returns a pointer to the created install.
The install is created with: - A unique fake name - A unique fake ID (26-character) - Associated with the given app - Associated with the org from context - Created by the account from context
The context must already have both org and account set via EnsureOrg and EnsureAccount.
func (*Seeder) EnsureOrg ¶
EnsureOrg creates a test organization and sets it in the context. Returns the updated context with the org ID set.
The organization is created with: - A unique fake name - OrgType: Sandbox - Status: Active - SandboxMode: true (no real cloud resources)
The returned context has the org ID set via cctx.SetOrgIDContext, which is required for most ctl-api operations that are scoped to an org.