Skip to content

QuertyCube/Java-API-Automation-Test-DummyAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DummyAPI Rest Assured Automation Test

Project Overview

This project demonstrates API automation testing using Java, Rest Assured, and JUnit 5 for the DummyAPI. It follows clean code principles and uses a simple pattern for API calls and reusable assertion helpers.

Tools, Frameworks & Versions

Tool/Framework Version Purpose
Java JDK 11+ Language/runtime
Maven 3.6+ (tested: 3.8/3.9) Build, dependency management
Rest Assured 5.3.0 API automation framework
JUnit Jupiter (JUnit 5) 5.9.3 Test framework
Maven Surefire Plugin 3.0.0-M7 Test execution
JSON Path (Rest Assured) 5.3.0 JSON parsing in tests

Setup Instructions

  1. Install Java (JDK 11 or newer)
    • Download OpenJDK or Oracle JDK.
    • Verify installation:
      java -version
      # Should show version 11 or newer
  2. Install Maven (3.6 or newer recommended)
    • Download Maven.
    • Verify installation:
      mvn -version
      # Should show Maven version 3.6 or newer
  3. Clone or copy this repository
    • Place all files in a directory, e.g. Java-API-Automation-Test-DummyAPI
  4. (Optional) Update app-id
    • The tests use the app-id 6112dc7c3f812e0d9b6679dd (see DummyApiTests.java). If you have a different app-id, update the constant in the test class.

Setup Instructions

  1. Install Java
  2. Install Maven
    • Download and install Maven.
    • Verify installation:
      mvn -version
  3. Clone or copy this repository
    • Place all files in a directory, e.g. Java-API-Automation-Test-DummyAPI
  4. (Optional) Update app-id
    • The tests use the app-id 6112dc7c3f812e0d9b6679dd (see DummyApiTests.java). If you have a different app-id, update the constant in the test class.

How to Run the Tests

  1. Open a terminal and navigate to the project root:
    cd /path/to/Java-API-Automation-Test-DummyAPI
  2. Run the test suite using Maven:
    mvn test

Example Output

[INFO] Results:
[INFO] 
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] BUILD SUCCESS

Test Run Output

Project Structure

  • pom.xml — Maven configuration (dependencies: Rest Assured, JUnit 5)
  • src/test/java/com/example/dummyapi/DummyApiTests.java — Main test class
  • src/test/java/com/example/dummyapi/client/ApiClient.java — For API calls
  • src/test/java/com/example/dummyapi/TestUtils.java — Reusable assertion helpers

Key Features

  • Validates response status, data types, and paging
  • Asserts all items in returned lists
  • Negative test for missing app-id
  • Clean code, reusable helpers, and simple design pattern

Troubleshooting

  • If tests fail due to network issues, check your internet connection.
  • If you get a 403/401 error, verify your app-id is correct and active.
  • For Java/Maven errors, ensure both are installed and on your PATH.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages