LESSON OBJECTIVE
What you will be able to do
Choose unit or integration scope deliberately and test supported databases with their real engines.
Unit tests own business rules
Pure services can be tested without network or database. Give inputs, call behavior, and assert outputs or explicit exceptions.
aml test
# then run the declared MySQL, MariaDB, and PostgreSQL matrixIntegration tests use real adapters
A repository or migration test is credible only against the real engine it claims to support. Maintain SQLite plus the declared server matrix.
Control time and randomness
Inject a clock and deterministic generator when expiration, IDs, tokens, or random choices affect the result.
CHECKPOINT
Before you continue
Would a fake adapter hide the very driver, locking, transaction, or filesystem behavior this test claims to prove?