Skip to content

Example of using JDK11 HttpClient and JAX-RS

Notifications You must be signed in to change notification settings

perchrh/jdk11_http_json_example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example of JDK11 Http Client + gradle + jersey + jackson + jetty, with Junit 5

In this example there is a JAX-RS HTTP/JSON-based service for registering new customers. A number of steps are carried out to register a new customer.

As an entry point, read the HTTP-API declared in CustomerOnboardingResource. Then follow the flow down to the CustomerOnboardingService.

Make sure to check out the test in CustomerOnboardingResourceTest, and the JDK11 Http Client usage in ApiClient.

Other classes of note are TestServer - an embedded Jetty server, and Application - the webapp.

Some uninteresting parts are glossed over. A TODO may be seen next to these parts. Data objects are mapped from the API of the frontend-layer to the API of the backend.

To compile from the command line, use $ ./gradlew clean build

Note that IntelliJ < 2019.1 doesn't automatically set the project SDK to JDK 11. Make sure to do that in module settings - project.

About

Example of using JDK11 HttpClient and JAX-RS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages