Dropwizard Courtesy Client Sample App
The sample service requires Java 1.8 and Gradle 2.9 or higher
The project contains three subprojects hosting the API, the application (service), and a courtesy client. Individual project structure is based on the Dropwizard recommended model. This results in the following package layout:
com.sample |- api |- client |- configuration |- service |- domain |- health |- resource |- service
There are three artifacts produced during a standard build:
The dependencies are set up as follows: service -> api <- client. This allows us to provide downstream services with the client as a courtesy, saving effort implementing the service's interface but without depending on it directly. Downstream services need only update their version of the client if a new version of the client has been produced because the API interface implemented by the service has changed.
Run Dropwizard service
Build, package and run the service:
To unit test:
To integration test:
The integration test provided currently does only the following:
- Run the service
- Call the service HTTP API using the client
Auto Generated Documentation
Swagger documentation is available for this service by visiting the following file path in your browser:
See the PersonResource class for information on how to annotate the methods so they are displayed in the documentation.
RAML API documentation is also hosted inside the sample-service, available on the following path:
The RAML API documentation is generated from a RAML API specification file,
apispec.raml, in the root of the project directory.