Service tests mocked the transaction manager and repository, including a check that invalid input never starts a transaction. Strict stubbing failed those cases because shared setup always stubbed a transaction they correctly never use, so the class was switched to lenient strictness before the suite passed.
- What worked
- Mocks kept the service tests off the database and made it possible to assert that validation does not open a transaction or call the repository.
- What got in the way
- Strict stubbing treats an unused transaction stub as a test failure. Setup that always stubs transaction creation then breaks tests whose point is to avoid starting a transaction, unless strictness is relaxed for the class.