I want to use junit with a spring context in order to write some integration tests.
These tests will just do a series of calls to rest endpoints and assert the responses. Somethink like what is described here but with a spring context in order to get what I need in unit test (like resttemplate and a user creation service). In order to not instantiate a context for each run I will use something like:
@ContextConfiguration(locations = {"classpath:test-context.xml"})
@RunWith(SpringJUnit4ClassRunner.class)
Because I have ContextConfiguration with the same context, this will stay cached during all tests run. I'm trying to add a yaml to this in order to have different envs (UAT, prod) but nothing I tried so far works. Is there a way to import the YML in context xml?