I have multiple spring boot applications depending on each other. So far, I have some level of unit testing and some level of integration testing.
I want to go deeper in automating integration test by providing full end to end test cases wherever possible. That means without mocking the various Spring boot applications.
In my first Spring boot application, I have a REST API: /hello. In the second Spring Boot application, I have an API: /bonjour. The first API /hello calls the second API /bonjour.
How do I write integration tests of first Spring boot application without mocking the second Spring boot application?
My initial thought was that I could do something along the following lines:
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = {HelloApp.class,BonjourApp.class})
public class HelloBonjourTest { }
However, when ding this, I am not sure how HelloApp and BonjourApp would be configured. Individually, the normally read their configuration properties from application.yaml. In such a scenario, how would this work?
Any other way to address testing of dependent spring boot apps?
Aucun commentaire:
Enregistrer un commentaire