Download JDK 8: https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
Configure JDK: https://docs.oracle.com/cd/E19182-01/820-7851/inst_cli_jdk_javahome_t/index.html
Download Maven: https://maven.apache.org/download.cgi
Configure Maven: https://maven.apache.org/install.html
Clone the ConsumerIoT repository which contains de project.
Once you have configured the JDK and Maven, run the following commands to:
mvn install => Downloads all the dependencies found in pom.xml, compiles the project and also runs the tests.
mvn install -DskipTests => Same as the previous command without running the tests
mvn test => Run only the tests
mvn spring-boot:start => Run Spring Boot app
mvn spring-boot:stop => Stop Spring Boot app
The project has unit and integration tests which can be executed by means of the above mentioned command mvn test.
Currently, the project has a coverage of +90% with unit tests which increases to +95% with integration tests.
*
I would like to mention that some test has been implemented on some private method to demonstrate
the handling of the Powermock library, knowing in advance that covering private methods would be a not good practice.
In order to test the api, I have provided a Postman collection (ConsumerIoT.postman_collection.json), which contains the existing endpoints and examples of calls for the different scenarios.
Download Postman: https://www.postman.com/downloads/
It is assumed that the only optional fields in the CSV file are "Latitude" and "Longitude".
- Add Swagger
- Java 8
- Spring Boot 2.5
- Lombok 1.18
- JUnit 5.7
- Mockito 3.11
- Powermock 2.0
- OpenCSV 5.4
- Maven 3