title: Running integration tests for a spring-boot REST service using gradle
body: <p>I am currently trying to setup integration test framework for a REST service which is built on: <br/></p>
  
  <ol>
  <li>Spring-boot</li>
  <li>Gradle</li>
  <li>Jetty <br/></li>
  </ol>
  
  <p>I was able to use <strong>spring-boot integration test framework</strong> along with <strong>spring-boot junit runner</strong> to bring up the app context and run the tests successfully.</p>
  
  <p>The next thing that I was trying to do was to have a <strong>gradle task</strong> which will do the following: <br/></p>
  
  <ol>
  <li>Build the jar(not war) <br/></li>
  <li>Start jetty and deploy the jar <br/></li>
  <li>Run a set of test-cases against this jar. <br/></li>
  <li>Stop jetty <br/></li>
  </ol>
  
  <p>=> I tried using the '<strong>jetty</strong>' plugin. But it does not seem to be supporting jar files.<br/>
  => I then tried using the <strong>JavaExec task</strong> to run the jar and then run the tests, but then I couldn't find a straight-forward way to stop the jar process after the tests are done. <br/>
  => The same issue with the Exec type task.</p>
  
  <p>So, I have two questions regarding this: <br/></p>
  
  <ol>
  <li><p>Is there a way to achieve the above said form of integration testing using gradle. <br/></p></li>
  <li><p>Is this way of integration-testing recommended or is there a better way of doing it?</p></li>
  </ol>
  
  <p>Any thoughts and insights are much appreciated.</p>
  
  <p>Thanks,</p>