I am developing an hexagonal application with BDD approach with Specflow (C# cucumber).
I want to implement automated scenario system test running the core and injecting test double on the port of the inner hexagon instead of the production adapters.
I am also using composition-root pattern, and that means that the core dependencies are resolved outside the core: that already smells to me (it is correct to resolve the dependencies of the core towards the outer hexagon injecting the adapters, but what about the internal dependencies of the core?).
Usually test classes resolve dependencies their way, injecting test double, but now they must be able to assemble core too. So now we do not have a single point of truth in resolving the dependencies of the core, cause the test must copy the composition root and if production composition root replace an internal service of the core modifying and breaking its behaviour, the automated test remain green, cause the test composition root still inject the old implementation of the service.
What is the correct solution to this issue? Thanks