I am adding cargo and failsafe to my Spring-Boot application.
Failsafe: Great. Finds my 1 IT and runs it fine as long as I have the localhost running. Up until now, I have gotten by with running it locally and then running the IT.
maven: Also great. It builds correctly with a minimum of fuss
Cargo: I am going nuts.
I have 3 property files that the Spring-Boot application resolves. Everything works and when I'm doing unit tests with SpringBootTest, it's great and everything resolves. (I have an application.properties in /src/main/resources and a test version in /src/test/resources and then a third outside my jar.)
When I try to start the application in cargo, only the /src/main/resources is loaded. I'm going nuts trying to figure out how to provide those other two files.
I've tried:
- tried
@TestSource(location = { "..../path/to/application.properties" })
@Theories
public class MyIT {
I tried adding to the arguments in my IDE. This worked, but I do not want to have all of that on the command line since there will be some security things.
I tried adding to the systemProperties, but that didn't work for spring properties.
How can I specify spring properties (not -Dsystem.properties) to cargo? This is going to be on a corporate Bamboo, and everything but this works. I even have sensitive properties encrypted with JaSypt, so that they aren't hanging around in the clear. I suppose I could re-run the verify task and use the spring arguments on the command line there, but it would be much better if it would just use the Spring properties.
There has to be a way to give cargo arguments that don't clobber everything else?
Edited and Added
I'm looking to do Selenium/HTMLUnit tests for the front end. @SpringBootTest
is not working for these automated tests, so the application properties are getting clobbered. The regular tests (i.e. mvn test
) work fine. The running of the application (i.e. java -jar MyApp.jar
) works fine and uses the internal, embedded Tomcat just fine. I'm looking for a setup that will run on mvn verify
, start the application in some kind of background (such as cargo?), and then run the tests.
I admit I'm not familiar with front end testing. If cargo still isn't the right tool, then I would appreciate tips on what is.