Clone the repository
git clone https://github.com/lghimfus/RCProject.git
Use Maven to build the project mvn clean package
Use Maven to test the code mvn test
java -cp target/RCProject-0.0.1-SNAPSHOT-jar-with-dependencies.jar com.lghimfus.app.RCProject.ConsoleApplication
java -cp target/RCProject-0.0.1-SNAPSHOT-jar-with-dependencies.jar com.lghimfus.app.RCProject.RestApplication
localhost:4567/vehiclesByPrice
localhost:4567/vehiclesBySpecs
localhost:4567/vehiclesBySupplierRating
localhost:4567/vehiclesByScore
NOTE:
The above endpoints return text/plain response containing the same output as the console application.
However, each endpoint supports the query parameter json
which recognizes two values: full
and custom
.
?json=full
returns an application/json response containing the JSON representation of a list of vehicles where a vehicle node contains all the fields available in a Vehicle class.?json=custom
returns an application/json response containing the JSON representation of a list of vehicles, but a vehicle node contains just the fields required for printing in part 1 (tasks 1-4).
Additional possible requests
localhost:4567/vehiclesByPrice?json=full
localhost:4567/vehiclesByPrice?json=custom
localhost:4567/vehiclesBySpecs?json=full
localhost:4567/vehiclesBySpecs?json=custom
localhost:4567/vehiclesBySupplierRating?json=full
localhost:4567/vehiclesBySupplierRating?json=custom
localhost:4567/vehiclesByScore?json=full
localhost:4567/vehiclesByScore?json=custom
localhost:4567/vehicles