I am looking to instantiate a spring boot test in code.
I have a set of cucumber test, which instantiate my app’s spring context using @SpringBootTest
, but I am now looking to leverage the same tests and steps code, but to run against my deployed app.
So I am looking to:
- check a system property
- instantiate a my local context in a
SpringBootTest
environment if system property set - instantiate a different
SpringBootTest
context which hits a live instance of my service.
Does anybody have any recommendations on how to do that?
P.S.
I use spring boot for my service, junit4 and maven.