This question is a follow-up question to Clean Architecture use case testing.
Suppose the production code injects Use Case Interactor
into the Input Boundary
- that happens somewhere in the main component1. But now I want to test the Input Boundary
/Output Boundary
of the use case. I can only think of two ways to do this:
- Recreate the dependency injection setup at the beginning of the test - this forces the test to depend on
Use Case Interactor
. - Depend on the main component for DI - this seems risky because the main component is volatile.
Is there a clean way to handle this situation?
1 Clean Architecture Chapter 26, Robert C Martin