December 2019
Intermediate to advanced
314 pages
6h 51m
English
Before testing our application, it is worth mentioning that the quarkus-jsonb dependency has been included in this project in order to produce JSON content through the REST endpoint and to create JSON objects programmatically in the test class. The following is the dependency we have included in the pom.xml file:
<dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-jsonb</artifactId></dependency>
The following is our CustomerEndpointTest class, which can be used to validate the Customer application:
@QuarkusTestpublic class CustomerEndpointTest { @Test public void testCustomerService() { JsonObject obj = Json.createObjectBuilder() .add("name", "John") .add("surname", "Smith").build(); // Test POST given() ...Read now
Unlock full access