# ./gradlew test (Testcontainers: postgres:17.6-alpine3.22, redis:8.4.0-alpine) total: 68 tests, 0 failed infrastructure.controllers.authentication.AuthenticationControllerTest: 9 tests, 0 failed, 7.132 s - logout revokes only the current token - Bearer token cannot open a session - password containing a colon and non-ASCII characters works - unknown token returns 401 - session expires after SESSION_TTL_SECONDS - each login issues a different token - valid Basic credentials open a session - missing or malformed Basic header returns 401 - wrong password and unknown user get the same 401 infrastructure.controllers.chat.ChatControllerTest: 6 tests, 0 failed, 2.173 s - member can read own chat and members keep their order - unknown member is rejected before anything is written - foreign chat returns 404 for non-member - cursor issued to another user is rejected - chat list contains only own chats and is paginated - invalid member lists are rejected with 400 infrastructure.controllers.health.HealthControllerTest: 2 tests, 0 failed, 0.127 s - live returns 200 - ready returns 200 when database is reachable infrastructure.controllers.message.MessageConcurrencyTest: 1 tests, 0 failed, 0.285 s - parallel senders produce exactly N unique messages infrastructure.controllers.message.MessageControllerTest: 7 tests, 0 failed, 1.826 s - foreign chat returns 404 when sending - last page has null next_cursor - pagination walks all messages exactly once - foreign chat returns 404 when listing - empty text returns 400 invalid_request - history that is an exact multiple of limit ends with null next_cursor - foreign cursor returns 400 infrastructure.controllers.message.MessageIdempotencyTest: 7 tests, 0 failed, 3.269 s - expired key can be used for a new message - key scope is user and chat - same key with another body is a conflict - missing or malformed key is rejected before anything is written - retry with the same key and body returns the original message - retry by a former outsider is still checked for access - concurrent retries create exactly one message infrastructure.controllers.user.UserControllerTest: 11 tests, 0 failed, 1.668 s - password shorter than 12 code points returns 400 - concurrent registrations of one username create exactly one user - X-User-Id alone gives no access - create user returns 201 without password - duplicate username returns 409 conflict - missing token returns 401 with Bearer challenge - invalid JSON body returns 400 invalid_request - missing password returns 400 - Basic credentials are rejected on business endpoints - me returns the session owner - X-User-Id does not override bearer identity infrastructure.repositories.authentication.session.cache.RedisSessionCacheRepositoryTest: 3 tests, 0 failed, 0.091 s - cached session round-trips and expires together with the session - revoke replaces a cached session with a tombstone - late cache fill cannot overwrite a tombstone infrastructure.repositories.chat.ExposedChatRepositoryTest: 2 tests, 0 failed, 0.498 s - chat row is rolled back when inserting members fails - successful creation commits the chat and every member infrastructure.services.authentication.SessionLookupSingleFlightTest: 4 tests, 0 failed, 1.122 s - request arriving after logout does not join a lookup started before it - without single-flight every concurrent miss queries the database - with single-flight concurrent misses share one database lookup - lookup that finished before a request arrived is not reused infrastructure.services.hashing.DefaultHashingServiceTest: 4 tests, 0 failed, 0.418 s - passwords differing only after 72 bytes are distinguished - validates the right password and rejects a wrong one - malformed hash is rejected instead of throwing - hash is a salted Argon2id PHC string plugins.CorsTest: 2 tests, 0 failed, 0.119 s - page of the API itself may call it - unknown origin is rejected plugins.DatabaseMigrationTest: 1 tests, 0 failed, 0.188 s - re-running migrations applies nothing and keeps data plugins.DependencyFailureTest: 5 tests, 0 failed, 13.637 s - without PostgreSQL requests fail with a bounded 503 - logout during a Redis outage survives an API restart - logout during a Redis outage is not undone by a stale cached copy - without Redis requests bypass the cache - hanging Redis costs one command timeout and recovers plugins.InstanceIdTest: 1 tests, 0 failed, 0.245 s - every response names the replica plugins.SessionCacheTest: 3 tests, 0 failed, 0.953 s - emptied cache falls back to PostgreSQL - first authenticated request fills the cache - logout leaves a tombstone and the token is rejected