- Description
- Architecture
- Endpoints and URL
- Supported Query Parameters by Search Service
- Response Codes
- Pre-requisite
- Local Build
- Run JUnits
Rest interface that allows searching of handset details by providing required criteria as part of query parameters.
- This service developed using Spring Boot which allowed easy injection of dependent objects using Spring IOC. Internally uses Spring RestTemplate to fetch details details service.
Method | Endpoint |
---|---|
GET | /mobile/search? |
Parameter Name |
---|
announceDate |
brand |
phone |
priceEur, price |
sim |
Response Code | Description |
---|---|
200 | Successfully processed request and returned. |
400 | Provided search criteria isn't valid for the data available. |
500 | Internal Error in processing request. |
- Java 8, Spring Boot 2.3
This service can run locally after checking out code from github using both gradle and general java -jar as below. As gradle doc suggests, service is build using wrapper to ensure reliable and standardized execution of build. Depending of Operating system we can run serice with gradle.bat or gradlew.
Building this API is as simple as running commands below
git clone https://github.com/baajarmeh/assignment-rest.git
cd assignment-rest
gradle.bat clean build
When we try to build jar using gradle.bat clean build
it runs spotless check, junits, code coverage along with prepare archive. But, if we want to
run JUnits, then use below command(Please note as this will internally call jacocoTestReport
to generate code coverage report).
gradle.bat test
Reports for tests can be found under build/reports/tests/test
and jacoco code coverage under build/reports/jacoco/test/html