Reputation: 298
I have to work with some old java application. There is a total of 6 projects which:
As part of this:
How I thought of testing this
My idea was to use single test project which will run all required projects using @SpringBootTest and mockmvc to mock real calls and transfer them inside test instead of using real endpoints.
The ask
Upvotes: 0
Views: 799
Reputation: 42551
When it comes to @SpringBootTest
its supposed to load everything that is required to load one single spring boot driven application.
So the "integration testing" referred in Spring Boot testing documentation is for one specific application.
Now, you're talking about 6 already existing applications. If these applications are all spring boot driven, then you can run @SpringBootTest
for each one of them, and mock everything you don't need. MockMvc
that you've mentioned BTW, doesn't start the whole application, but rather starts a "part" of application relevant for web request processing (for example it won't load your DAO layer), so its an entirely different thing, do not confuse between them :)
If you wan't to test the whole flow that involves all 6 services, you'll have to run a whole enviroment and run a full-fledged system test that will be executed on a remote JVM. In this case you can containerize the applications and run them in test with TestContainers.
Obviously you'll also have to provide containers for databases if they have any, messaging systems, and so forth.
All-in-all I feel that the question is rather vague and lacks concrete details.
Upvotes: 1