Skip to content

This project serves as an educational API testing framework for learning Rest Assured, TestNG, and JavaFaker. Designed to teach API automation testing fundamentals through practical examples and hands-on exercises.

License

Notifications You must be signed in to change notification settings

cihat-kose/restassured-api-test-lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rest Assured API Test Lab

Java RestAssured TestNG Hamcrest Jackson JavaFaker Jenkins


Table of Contents

  1. Project Overview
  2. Features
  3. Installation
  4. Configuration
  5. Usage
  6. Folder Structure
  7. Dependencies
  8. Reporting and Logs
  9. HTTP Status Codes
  10. Contributors
  11. License
  12. Contact

Project Overview

The Rest Assured API Test Lab is an API testing framework designed to automate the testing of backend services.
This project uses Rest Assured, TestNG, Hamcrest, and JavaFaker to ensure the accuracy and stability of API endpoints.
It is tailored for educational purposes and testing REST APIs for the Mersys Campus application.


Features

  • Automated API Testing – Supports CRUD operations with GET, POST, PUT, and DELETE requests.
  • Dynamic Data – Uses JavaFaker to generate random data for testing.
  • Reusable Components – Modular design for reusable request and response specifications.
  • Logging and Reporting – Logs API requests and responses, with TestNG-generated HTML reports.
  • Parallel Execution – Supports concurrent test execution for efficiency.

Installation

1. Clone the Repository

git clone https://github.com/cihat-kose/restassured-api-test-lab.git

2. Import the Project (IntelliJ IDEA)

  1. File > New > Project from Version Control
  2. Enter Repository URL:
    https://github.com/cihat-kose/restassured-api-test-lab.git
  3. Maven auto-import will download dependencies automatically.

⚙️ If dependencies are not downloaded automatically:

mvn clean install

3. Recommended Plugins (IntelliJ IDEA)

  • TestNG
  • Maven Helper
  • REST Client
  • Lombok (Optional if used in the project)

4. Verify Installation

Run the following command to verify that tests execute correctly:

mvn test

Configuration

API Endpoint

  • Base URI: https://test.mersys.io
  • Authentication:
{
  "username": "turkeyts",
  "password": "TechnoStudy123",
  "rememberMe": true
}
  • Endpoints:
    • Create Attestation: /school-service/api/attestation
    • Update Attestation: /school-service/api/attestation
    • Delete Attestation: /school-service/api/attestation/{id}

Usage

Running Tests

To run all tests:

mvn clean test

Or, right-click on any test file in IntelliJ and select:
Run 'ClassName'


Folder Structure

restassured-api-test-lab/
│
├── src/
│   └── test/
│       ├── java/
│       │   ├── campus/                # Campus API tests
│       │   └── reqresIn/              # Reqres API tests
│       └── resources/
│           └── testng.xml             # TestNG configuration
├── target/                            # Build output
├── images/                            # Project images
│   └── HTTP_Status_Codes.png
├── LICENSE                            # License file (MIT License)
├── pom.xml                            # Maven dependencies
└── README.md                          # Project documentation

Dependencies

Managed in pom.xml. Key dependencies include:

  • Rest Assured – API testing
  • TestNG – Test execution
  • Hamcrest – Enhanced assertions
  • Jackson – JSON parsing
  • JavaFaker – Dynamic data generation

Reporting and Logs

  • HTML Reports – Available at target/surefire-reports/.
  • Logs – API requests and responses are logged for debugging.
cat target/surefire-reports/emailable-report.html

HTTP Status Codes

This project commonly encounters a variety of HTTP status codes in responses.
Below is a summary of some frequently used status codes and their meanings:

HTTP Status Codes


Contributors

To contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Commit your changes (git commit -m 'Add new feature').
  4. Push to the branch (git push origin feature-branch).
  5. Create a Pull Request.

License

This project is licensed under the MIT License.
See the LICENSE file for details.


Contact

For any questions or contributions, please open an issue in this repository.

About

This project serves as an educational API testing framework for learning Rest Assured, TestNG, and JavaFaker. Designed to teach API automation testing fundamentals through practical examples and hands-on exercises.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages