appstoretest

package
v0.1.42 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunAll

func RunAll(t *testing.T, factory Factory)

RunAll runs the complete AppRegistrationStore test suite against the provided factory.

func TestAllFieldsRoundTrip

func TestAllFieldsRoundTrip(t *testing.T, factory Factory)

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

func TestDeleteApp(t *testing.T, factory Factory)

TestDeleteApp verifies that DeleteApp removes the registration and subsequent GetApp returns ErrAppNotFound.

func TestDeleteNonexistent

func TestDeleteNonexistent(t *testing.T, factory Factory)

TestDeleteNonexistent verifies that deleting a missing client_id returns ErrAppNotFound, matching KeyStorage.DeleteKey semantics.

func TestListApps

func TestListApps(t *testing.T, factory Factory)

TestListApps verifies that ListApps returns every saved registration.

func TestListAppsEmpty

func TestListAppsEmpty(t *testing.T, factory Factory)

TestListAppsEmpty verifies that ListApps on a fresh store returns an empty slice (not an error).

func TestNotFound

func TestNotFound(t *testing.T, factory Factory)

TestNotFound verifies that GetApp on a missing client_id returns ErrAppNotFound.

func TestOverwriteApp

func TestOverwriteApp(t *testing.T, factory Factory)

TestOverwriteApp verifies that SaveApp on an existing client_id replaces the stored registration with the new metadata.

func TestPersistence

func TestPersistence(t *testing.T, factory Factory)

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

func TestSaveAndGet(t *testing.T, factory Factory)

TestSaveAndGet verifies that SaveApp followed by GetApp returns the saved registration.

Types

type Factory

type Factory func(t *testing.T) core.AppRegistrationStore

Factory creates a fresh AppRegistrationStore for each test.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL