I've got Spring service A which internally uses service B.
I want:
- Mock service
B - Set mocked version into service
A - Test service
Abehavior - Set previous version of service
Bto serviceA(reset state)
The problem is last step - I can remember B at setup and set it in cleanup stages. But can I configure to do it automatically (something similar to @ConfineMetaClassChanges)
This isn't supported out-of-the-box, but it could be implemented as a JUnit rule or Spock extension. (
@ConfineMetaClassChangesis a Spock extension.)