The goal of the challenge is to create a dockerized web service such that the following HTTP request, for the variable $name
curl -X POST http://localhost:8080/messages/names/$nameproduces a response with header Content-Type: application/json and JSON payload:
{"message": { "content": "Hello $name"}}Furthermore, the service must meet the following requirements:
- Code must be stored on github and be in a fork of this repository
- Code must be written in java
- Maven is used to build the project and produce a war file
- Jetty is used as the web server
- The REST interface is produced by Jersey
- It must have a class
MessageResourcecontaining the REST API definition and aMessageServiceclass, that performs the logic. - It must use Spring for injecting the singleton
MessageServicebean into theMessageResourcebean - JAX RS / Jackson is used for serializing a
MessageDTO class into the REST response. - The project must be built as a docker image using a Dockerfile starting with
FROM ubuntu:trusty, and run as a docker container. - The docker image must be built using maven using mvn package
- Jetty, including the web-application, should start when docker start is issued for the created docker image.
- You have to write every line of code yourself, but you can ask anyone for help. No-one is required to help though.