Skip to content

Latest commit

 

History

History
26 lines (16 loc) · 1.91 KB

README.md

File metadata and controls

26 lines (16 loc) · 1.91 KB

Karate and Quarkus

This is a "standard" Quarkus project adapted from the Quarkus getting started guide.

A few highlights:

  • shows how to run Karate via JUnit using the @QuarkusTest annotation
  • uses an injected @TestHTTPResource to get the URL after resolving the (dynamic) port that the Quarkus application is running on
  • the Karate script greeting.feature has two tests for each REST end-point
  • shows how the URL (including dynamic port number) is passed to Karate from the Quarkus environment in GreetingTest.java
  • Uses <classifier>all</classifier> in the Maven pom.xml to avoid conflicts with Quarkus dependencies
    • we also use karate-core instead of karate-junit5 as JUnit is brought in by quarkus-junit5
  • Uses the quarkus-logging-logback extension to bridge Karate with Quarkus' logging system
    • note the over-ride of the ch.qos.logback:logback-classic dependency since Quarkus requires a higher version

Graal

Quarkus heaviliy depends on Graal and so does Karate, so watch out for NoClassDefFoundError or polyglot in stack traces. You may need to adjust dependencies so that Karate works without issues. Refer to this thread for more details.

Running

Run mvn test to execute the JUnit test: GreetingTest.java