mockSource is a source.Source that returns canned metadata for OwnerService tests. It only implements the methods needed for buildKnownOwners (Owner, RepoName) plus the Source interface contract that the rest of the package relies on. For pre-warm/probe tests, GetMeta is sha-aware: it owns exactly
| 76 | // is reported as not-owned (error). getMetaCalls counts calls so tests can |
| 77 | // assert the negative cache suppresses repeat probes. |
| 78 | type mockSource struct { |
| 79 | owner string |
| 80 | repoName string |
| 81 | typ string |
| 82 | commit string |
| 83 | |
| 84 | getMetaCalls *atomic.Int32 |
| 85 | getMetaErr error // when set, GetMeta always returns this error |
| 86 | } |
| 87 | |
| 88 | func (s *mockSource) GetMeta(_ context.Context, commit string) (content.Meta, error) { |
| 89 | if s.getMetaCalls != nil { |
nothing calls this directly
no outgoing calls
no test coverage detected