title: Is there a way to run Karate tests as an integration test suite against a pre-booted spring boot server?
body: <p>Is there any good way to get Karate tests to test a Spring-Boot microservice in the "integration-test" phase of a Maven build?   What I mean is: is there an anti-pattern/workaround that works well OR am I out of luck because this was an afterthought of the Karate development?</p>
  
  <p>Facts I have gathered so far:</p>
  
  <ol>
  <li><p>It says here: "the surefire plugin is not hardcoded into Karate"
  <a href="https://stackoverflow.com/questions/48521404/is-there-a-way-to-run-karate-test-during-mavens-integration-test-phase">Is there a way to run Karate test during maven&#39;s integration test phase?</a></p></li>
  <li><p>Running Karate tests in context of maven-failsafe-plugin does not work at all.  Easy to reproduce on my test project url below.  Two problems foremost:</p>
  
  <ol>
  <li>When running from  maven-failsafe, Karate will generate .txt and .html files but does not generate .json Cucumber output files.</li>
  <li>Therefore, you can get no HTML report from the cucumber-reporting plugin (which I require)</li>
  </ol></li>
  <li><p>I created a project to demonstrate these facts:  <a href="https://github.com/djangofan/karate-api-sample" rel="nofollow noreferrer">https://github.com/djangofan/karate-api-sample</a></p></li>
  <li><p>Running integration tests requires that I start Spring Boot before the test suite and then stop the spring boot server afterwards.  Maven SureFire does not have this capability BUT the maven failsafe plugin does:   the maven build helper plugin has a pre-integration-test hook for it.   Limited only by Maven surefire, I am out of luck.</p></li>
  <li><p>I see an example in the karate/karate-demo project  of starting the spring boot server from code.   This is not easy to accomplish when I am trying to test a web service that is already established.   Is this my only option:  to use surefire with a class filter and code to bootstrap?</p></li>
  <li><p>Given no good answer, I will just revert to using <code>cucumber-java</code> + <code>resteasy</code>, which I am pretty sure will work with maven failsafe:  <a href="https://maven.apache.org/surefire/maven-failsafe-plugin/examples/cucumber.html" rel="nofollow noreferrer">https://maven.apache.org/surefire/maven-failsafe-plugin/examples/cucumber.html</a></p></li>
  </ol>