I have a Spring Boot application that launches the Karate tests programmatically, in the main source-set. This application is supposed to configure per environment several URLs that will be used by Karate. I also have a spring-cloud-config server that loads the yaml property file that corresponds to the current environment (dev, prod, etc). As such, my properties are not local to the project and are not readable outside of a Spring Boot property component.
With all that in mind, I want my Karate tests to use these configurable URLs, but I find no way to use the Spring Boot component containing my properties in a Karate context.
As further information, to run the Karate tests programmatically I'm using JUnitCore#runClasses :
@SpringBootApplication
public class MyApplication {
public static void main(String[] args) {
SpringApplication.run(MyApplication.class, args);
// Run all tests in the application
Result result = JUnitCore.runClasses(KarateApplicationRunner.class);
}
}
with the KarateApplicationRunner being a runner launching the tests and generating a report.
If someone has a functioning idea it would make my day :) .