Skip to content

Latest commit

 

History

History

README.md

quarkus-web-java project

Demonstrate testing of REST service.

In this example we use jsonb, resteasy, hibernate-validater for implementing REST-Service.

For testing we use junit5, mockito, rest-assured. When you have installed a GraalVM you can also see how an native image is tested.

The library itself is not tested, because it is there to demonstrate how to mock

For more details:

generate project structure

mvn io.quarkus:quarkus-maven-plugin:1.4.2.Final:create \
    -DprojectGroupId=de.novatec.aqe.cloud \
    -DprojectArtifactId=quarkus-web-java \
    -DprojectVersion=1.0.0-SNAPSHOT \
    -DclassName="web.api.BookResource" \
    -Dextensions="quarkus-resteasy,quarkus-resteasy-jsonb,quarkus-smallrye-openapi,quarkus-hibernate-validator" \
    -DbuildTool=gradle

Creating a native executable

for building and testing a native executable follow this guide: Building a Native Executable

In this articel you learn how to handle reflection classes, proxy classes, third party libs etc: Tips for writing native applications

You can create a native executable using: ./gradlew build -Dquarkus.package.type=native.

Or, if you don't have GraalVM installed, you can run the native executable build in a container using: ./gradlew build -Dquarkus.package.type=native -Dquarkus.native.container-build=true.

You can then execute your native executable with: ./build/quarkus-web-java-1.0.0-SNAPSHOT-runner

If you want to learn more about building native executables, please consult https://quarkus.io/guides/gradle-tooling#building-a-native-executable.