MCPcopy Create free account
hub / github.com/bytebase/bytebase / fakeWorkspaceResolver

Struct fakeWorkspaceResolver

backend/api/oauth2/token_test.go:19–26  ·  view source on GitHub ↗

fakeWorkspaceResolver implements workspaceResolver for unit tests so we can exercise resolveBoundWorkspace without standing up a real Postgres store.

Source from the content-addressed store, hash-verified

17// fakeWorkspaceResolver implements workspaceResolver for unit tests so we can
18// exercise resolveBoundWorkspace without standing up a real Postgres store.
19type fakeWorkspaceResolver struct {
20 singleton string
21 singletonErr error
22 findResult *store.WorkspaceMessage
23 findErr error
24 findCallCount int
25 lastFind *store.FindWorkspaceMessage
26}
27
28func (r *fakeWorkspaceResolver) GetWorkspaceID(_ context.Context) (string, error) {
29 return r.singleton, r.singletonErr

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected