I'd like to write a end to end test for a pipeline, built with spring boot.
Consider two microservices A, B where B consumes output from A and produces a RESTful API. They are connected using rabbitmq and rely on an external database.
I would like to achieve something like:
- Create a new project that includes both microservices
- Create a test configuration that configures JPA provider to be an in-memory database
- Inject custom MQ into A, B to connect them (rabbitmq is not tightly coupled)
- Write tests
Essentially replacing the white parts with mocks and testing the coloured parts.
Does this make sense? Test coverage of A and B is not complete and such a test would guarantee that the contract between A and B holds. Are there better ways?
Aucun commentaire:
Enregistrer un commentaire