Documentation
¶
Overview ¶
Package appstoretest provides a shared contract test suite for all AppRegistrationStore implementations. Each backend (inmem, fs, gorm) calls these tests with its own factory function. Mirrors keystoretest.
Index ¶
- func RunAll(t *testing.T, factory Factory)
- func TestAllFieldsRoundTrip(t *testing.T, factory Factory)
- func TestDeleteApp(t *testing.T, factory Factory)
- func TestDeleteNonexistent(t *testing.T, factory Factory)
- func TestListApps(t *testing.T, factory Factory)
- func TestListAppsEmpty(t *testing.T, factory Factory)
- func TestNotFound(t *testing.T, factory Factory)
- func TestOverwriteApp(t *testing.T, factory Factory)
- func TestPersistence(t *testing.T, factory Factory)
- func TestSaveAndGet(t *testing.T, factory Factory)
- type Factory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunAll ¶
RunAll runs the complete AppRegistrationStore test suite against the provided factory.
func TestAllFieldsRoundTrip ¶
TestAllFieldsRoundTrip verifies that every field on AppRegistration survives a SaveApp/GetApp round-trip. Catches backend serialization bugs (e.g., GORM forgetting to JSON-encode slice fields).
func TestDeleteApp ¶
TestDeleteApp verifies that DeleteApp removes the registration and subsequent GetApp returns ErrAppNotFound.
func TestDeleteNonexistent ¶
TestDeleteNonexistent verifies that deleting a missing client_id returns ErrAppNotFound, matching KeyStorage.DeleteKey semantics.
func TestListApps ¶
TestListApps verifies that ListApps returns every saved registration.
func TestListAppsEmpty ¶
TestListAppsEmpty verifies that ListApps on a fresh store returns an empty slice (not an error).
func TestNotFound ¶
TestNotFound verifies that GetApp on a missing client_id returns ErrAppNotFound.
func TestOverwriteApp ¶
TestOverwriteApp verifies that SaveApp on an existing client_id replaces the stored registration with the new metadata.
func TestPersistence ¶
TestPersistence verifies that a saved registration is visible to subsequent reads from the same store handle. For persistent backends (FS, GORM) this catches write-buffering bugs; for InMem it is trivially true.
func TestSaveAndGet ¶
TestSaveAndGet verifies that SaveApp followed by GetApp returns the saved registration.