December 2019
Intermediate to advanced
314 pages
6h 51m
English
Along with the sample endpoint, the Maven plugin automatically included a test class for our REST service:
package com.packt.quarkus.chapter2; import io.quarkus.test.junit.QuarkusTest;import org.junit.jupiter.api.Test; import static io.restassured.RestAssured.given;import static org.hamcrest.CoreMatchers.is; @QuarkusTestpublic class SimpleRestTest { @Test public void testHelloEndpoint() { given() .when().get("/helloworld") .then() .statusCode(200) .body(is("hello")); } }
Under the hood, this test class uses JUnit as the core testing framework and the REST Assured library:
<dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-junit5</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>io.rest-assured</groupId> ...
Read now
Unlock full access