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 ¶
- func RunAll(t *testing.T, factory Factory)
- func TestConcurrentWritersOneWins(t *testing.T, factory Factory)
- func TestCreateThenGet(t *testing.T, factory Factory)
- func TestCreateWhenPresentConflicts(t *testing.T, factory Factory)
- func TestDeleteIsIdempotent(t *testing.T, factory Factory)
- func TestGetMissing(t *testing.T, factory Factory)
- func TestKeysAreIndependent(t *testing.T, factory Factory)
- func TestUpdateMissingConflicts(t *testing.T, factory Factory)
- func TestUpdateNeedsCurrentVersion(t *testing.T, factory Factory)
- type Factory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestConcurrentWritersOneWins ¶
TestConcurrentWritersOneWins: writers racing from the same version produce exactly one success, which is the refresh-race guarantee StoredUserToken relies on.
func TestCreateThenGet ¶
TestCreateThenGet: a create is version 1 and reads back byte for byte.
func TestCreateWhenPresentConflicts ¶
TestCreateWhenPresentConflicts: ExpectedVersion 0 means create only.
func TestDeleteIsIdempotent ¶
TestDeleteIsIdempotent: delete removes the record and a second delete succeeds. A create after delete starts at version 1 again.
func TestGetMissing ¶
TestGetMissing: no record is ErrUserTokenNotFound.
func TestKeysAreIndependent ¶
TestKeysAreIndependent: provider and subject together are the key, including subjects that differ only in characters a file name loses.
func TestUpdateMissingConflicts ¶
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 ¶
TestUpdateNeedsCurrentVersion: a stale version is refused, the current one is accepted and bumps the version.