This project is aimed at demonstrating API testing using Unirest, a lightweight HTTP client library in Java. It also utilizes Lombok for reducing boilerplate code, Extent Report for test reporting, and follows the builder pattern for constructing HTTP requests.
src
├── main
│ ├── java
│ │ ├── base
│ │ ├── controllers
│ │ ├── helpers
│ │ └── services
│ └── resources
│ └── templates
│ └── CreateUser.json
└── test
├── java
│ └── services
│ └── jsonplaceholder
│ ├── posts
│ └── users
└── resources
- src/main/java: Contains the main Java source code.
- base: Contains base classes for setting up configurations, logging, etc.
- controllers: Contains classes for API controllers.
- helpers: Contains helper classes for handling utilities, assertions, etc.
- services: Contains classes for interacting with external services or APIs.
- src/main/resources: Contains resource files.
- templates: Contains template files for payloads, configurations, etc.
- src/test/java: Contains the test Java source code.
- services/jsonplaceholder: Contains test classes for services related to the JSONPlaceholder API.
- posts: Contains test classes for the posts endpoint.
- users: Contains test classes for the users endpoint.
- src/test/resources: Contains test resource files.
- Unirest: Lightweight HTTP client library.
- Lombok: Java library for reducing boilerplate code.
- Extent Report: Reporting library for generating test reports.
- Clone the repository:
git clone https://github.com/tariful-islam98/Unirest_Bulder_Pattern_JSONPlaceholder.git
- Navigate to the project directory:
cd unirest-java-project
- Build the project using Maven:
mvn clean install
- Run the tests:
mvn test
After running the tests, you can find the Extent Report in the target/reports
directory.
Contributions are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.