The purpose of the suite is to test the content in the REST services (JSON files) using Functional Programming in Java Streams and Lambda Expressions.
java -version
- Java 8
- Rest Assured
- JUnit and TestNG
- Gradle
gradle test --tests TestClassName
gradle test --tests com.microservice.regression.packageName* -- info
gradle test --tests TestClassName --info > testFile.txt
gradle test --tests TestClassName --info --stacktrace
./gradlew test
- given() -> set cookies, add auth, add param, set headers info
- when() -> get, post, put delete
- then() -> validate status code, extract response, extract headers cookies and response body
To be able to create tests cases to validate the content in the services, I created a JSON file from scratch. For example: movies.service.json
.
However, creating a huge payload takes time, so I have taken already existing JSON files to test from: samayo Thanks to him!
- Used
https://reqres.in/
to use dummy REST service Apis for testing - Create custom API:
https://github.com/typicode/json-server
orhttps://www.mockapi.io/
orhttps://my-json-server.typicode.com/