Having extracted the App from github, perform the following steps to build, configure and execute the App:
mvn clean install
./mvnw spring-boot:run
- Junit Tests for Domain classes are not required.
- Spring Junit Tests for the integration tier are provided.
Mock MVC Tests have been generated for the Web/Rest Tier, to exercise the REST API ( and subsequent tiers) , by using Mock API REST requests to emulate real REST requests to the API. Invoke the tests vai maven with;
mvn test
Postman has been used as the REST Client and the following requests were configured for testing the api;
- GET to http://localhost:8080/api/zoo/animals
- POST to http://localhost:8080/api/zoo/animals/feed
- GET to http://localhost:8080/console/zoo
These will respectively feed the Animals in the Zoo, report on their status and display the console.
The Zoo application can also be accessd via a management console, that allows the current state of the anaimals in the Zoo to be viewed, togther with the option to 'Feed' the animals. The console is accessed from the URL;
For further reference, please consider the following sections:
- Official Apache Maven documentation
- Spring Boot Maven Plugin Reference Guide
- Spring Web
- Spring Data JPA
The following guides illustrate how to use some features concretely:
- Building a RESTful Web Service
- Serving Web Content with Spring MVC
- Building REST services with Spring
- Accessing Data with JPA
Built in IntelliJ