This is a submission to the neusta code challenge 2017. The following technologies have been used for the implementation: maven, java, spring boot, swagger and optional docker.
Three endpoints are available after starting the application:
- POST /api/import consumes multipart/form-data
- GET /api/room/{roomNumber} produces JSON
- GET /api/room produces JSON
The acceptance criteria are not completely clear regarding the following question: Can a room be searched for by person details? For example, shall I be able to enter a person's name/ldap and the application returns the room?
In case the above mentioned criteria is required, a quick solution was implemented in the third endpoint. It accepts the optional query parameter "ldapUser". Searching by "ldapUser" returns a list of all rooms that have a person assigned whose ldap user name contains the given string.
If the possibility to search for user details is a required feature, two additional endpoints should be implemented:
- GET /api/persons/{ldapUser}
- GET /api/persons?firstName=...&lastName=...&ldapUserName=...
The returning JSON should contain a link to the corresponding rooms (see HATEOAS).
Due to time constrains no ARC42 documentation is created.
Decision | Reason |
---|---|
Java |
|
Spring |
|
Spring Boot |
|
Hexagonal (or onion) architecture |
|
- Java 17
- Maven >= 3.2.1
- Docker optional
mvn clean package
java -jar target/ncc.jar
To build docker image a docker service must run on host system.
mvn clean package docker:build
docker run -d -p 8080:8080 ncc/ncc
After starting the application, please open swagger ui access the rest endpoints documentation.
mvn clean cobertura:cobertura
and open target/site/cobertura/index.html
in your browser.