Skip to content

Latest commit

 

History

History
26 lines (14 loc) · 1.73 KB

README.md

File metadata and controls

26 lines (14 loc) · 1.73 KB

Karate and Micronaut

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

A few highlights:

  • shows how to run Karate via JUnit using the @MicronautTest annotation
  • uses an @Inject-ed EmbeddedServer to get the URL after resolving the (dynamic) port that the Micronaut application is running on
  • the Karate script hello.feature has a test for the /hello end point
  • shows how the URL (including dynamic port number) is passed to Karate from the Micronaut environment in HelloTest.java
  • Uses <classifier>all</classifier> in the Maven pom.xml to avoid conflicts with Micronaut dependencies

Graal

Micronaut heavily depends on Graal and so does Karate which requires us to align the versions pulled in by the pom.xml. This is why we have the additional entries for org.graalvm.js:js-scriptengine and org.graalvm.js:js and we force them to be the version that Micronaut needs.

If you see the application hanging or things like a NoClassDefFoundError and polyglot or "graal" mentioned in the stack traces, you need to adjust this.

Running

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