I developed two projects for this task, one exactly as requested (small application in Java), the second I developed in a robust architecture using Spring and tests in JUnit, just to complement the challenge. Only the first was mandatory to solve the task.
The two projects are explained below:
The idea of this project was to meet the designed task: "develop a small java application" The source code is in a single file with pure java, all very simple.
- Java 8 or any higher version
Execute the commands below:
- cd task-in-small-java-app
- javac InPoweredTest.java
- java Main
This second project is just additional, evaluating it is optional, just to have the possibility to see the same task developed in a more robust Rest API project.
It was developed using Spring, testing (unit and integration) on JUnit, data was migrated using Flyway to a local H2 database.
- Java 8 or any higher version
- Maven
mvn test
mvn spring-boot:run
- http://localhost:8080/address-book/count-males
- http://localhost:8080/address-book/person/oldest
- http://localhost:8080/address-book/person/name1/{name1}/name2/{name2}/diff-age-days
- From Spring Boot Actuator: http://localhost:8080/actuator/health
To enter any endpoint you can use curl:
curl { endpoint url }
(or just copy the endpoint url in your browser)