usertokentest

package
v0.3.21 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 7 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 usertokentest is the shared contract suite for outbound.UserTokenStore. Each backend runs RunAll with a factory that returns a fresh, empty store.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunAll

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

RunAll runs every contract test against factory.

func TestConcurrentWritersOneWins

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

TestConcurrentWritersOneWins: writers racing from the same version produce exactly one success, which is the refresh-race guarantee StoredUserToken relies on.

func TestCreateThenGet

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

TestCreateThenGet: a create is version 1 and reads back byte for byte.

func TestCreateWhenPresentConflicts

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

TestCreateWhenPresentConflicts: ExpectedVersion 0 means create only.

func TestDeleteIsIdempotent

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

TestDeleteIsIdempotent: delete removes the record and a second delete succeeds. A create after delete starts at version 1 again.

func TestGetMissing

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

TestGetMissing: no record is ErrUserTokenNotFound.

func TestKeysAreIndependent

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

TestKeysAreIndependent: provider and subject together are the key, including subjects that differ only in characters a file name loses.

func TestUpdateMissingConflicts

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

TestUpdateMissingConflicts: a non-zero version on a missing record is a conflict, not a create, so a deleted record isn't revived by a refresh.

func TestUpdateNeedsCurrentVersion

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

TestUpdateNeedsCurrentVersion: a stale version is refused, the current one is accepted and bumps the version.

Types

type Factory

type Factory func(t *testing.T) outbound.UserTokenStore

Factory returns a fresh, empty store for one subtest.

Jump to

Keyboard shortcuts

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