Skip to content

DonLMJ/rest-assured-testng

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

REST Assured TestNG Project Overview

This project utilizes REST Assured and TestNG to perform API testing across multiple endpoints. It follows best practices in software testing, including abstraction, encapsulation, and multiple levels of test implementations.

Project Structure

The project structure follows a modular approach for better organization and scalability:

  • src/main/java: Contains utility classes, helper methods, and reusable components for API interactions.
  • src/test/java: Houses the actual test cases written using TestNG annotations.
  • src/test/resources: Stores test data, configuration files, and any other necessary resources.

TestNG Test Suite

TestNG is used to create and manage test suites, enabling easy configuration and execution of tests. Each test suite is designed to cover different aspects of API testing, such as:

  • Functional Tests: Verify the functionality of individual API endpoints by sending requests and validating responses.
  • Integration Tests: Test interactions between different API endpoints or modules to ensure seamless integration.
  • Regression Tests: Detect and prevent regressions by retesting previously working functionalities after code changes.
  • Performance Tests: Evaluate the performance of APIs under various load conditions to identify bottlenecks and optimize performance.

REST Assured

REST Assured is a powerful Java library for testing RESTful APIs. It simplifies API testing by providing a domain-specific language (DSL) for writing test cases. Key features include:

  • Request Specification: Define request parameters such as headers, query parameters, and authentication details.
  • Response Specification: Specify expected response properties and perform assertions on response data.
  • Given-When-Then Structure: Follows a clear structure for test cases, enhancing readability and maintainability.
  • Built-in Matchers: Includes a wide range of built-in matchers for validating response status codes, headers, and body content.

Abstraction and Encapsulation

Abstraction and encapsulation principles are applied throughout the project to improve code maintainability and reusability:

  • Abstraction: Complex API interactions are abstracted into reusable methods and utility classes, hiding implementation details from test cases.
  • Encapsulation: Data and behavior are encapsulated within classes, exposing only necessary methods and properties to the calling code.

Conclusion

This REST Assured project with TestNG demonstrates a systematic approach to API testing, emphasizing best practices such as abstraction, encapsulation, and modularization. By leveraging the power of REST Assured and TestNG, the project ensures robust and reliable testing of APIs across various levels of complexity.

Feel free to reach out for further details or to contribute to this project!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published