This is a Java project/framework for API testing. In this project I have used two RAPID APIs.
- https://rapidapi.com/api-sports/api/covid-193
- https://rapidapi.com/symanto-symanto-default/api/sentiment-analysis9
- Java
- IDE: Eclipse
- Frameworks: Junit (testNg is almost similar)
- Report Generator: surefire
- Rest-assured
- Maven
- Get all current statistics for USA.
- Detect the text-level sentiment.
Creating POJO for statistics API. This is a difference in the given schema and the actual output.
- SCHEMA: { "type": "object", "properties": { "errors": { "type": "array" }, "get": { "type": "string" }, "parameters": { "type": "array" }, "response": { "type": "array", "items": { "type": "object", "properties": { "cases": { "type": "object" }, "country": { "type": "string" }, "day": { "format": "date", "type": "string" }, "deaths": { "type": "object" }, "tests": { "type": "object" }, "time": { "format": "date-time", "type": "string" } } } }, "results": { "type": "integer" } } }
- ACTUAL: { "errors": [], "get": "statistics", "parameters": [], "response": [ { "cases": { "1M_pop": "58", "active": 73, "critical": 3, "new": "+5", "recovered": 78315, "total": 83022 }, "continent": "Asia", "country": "China", "day": "2020-06-02", "deaths": { "1M_pop": "3", "new": null, "total": 4634 }, "population": 1439323776, "tests": { "1M_pop": null, "total": null }, "time": "2020-06-02T20:45:06+00:00" }, { "cases": { "1M_pop": "0.9", "active": 1, "critical": 0, "new": null, "recovered": 1, "total": 2 }, "continent": "Africa", "country": "Lesotho", "day": "2020-06-02", "deaths": { "1M_pop": null, "new": null, "total": 0 }, "population": null, "tests": { "1M_pop": null, "total": 283 }, "time": "2020-06-02T20:45:06+00:00" } ], "results": 227 }
- clone this project
- Install the dependency
- Verify project build is correct
- In run configuration: Run as maven build : clean test package site (This will clean the target, run the test, create a .jar file and create site as report.)
RUN THIS PROJECT



