A clean Java + REST Assured test framework built with Maven/TestNG and integrated with Jenkins for full CI/CD automation.
- Implements REST API tests using REST Assured and TestNG
- Uses Maven to manage dependencies & run tests
- Integrates with Jenkins to trigger tests on code changes or schedules
- Produces reports (e.g., TestNG, HTML) after each Jenkins build
-
Clone the repo
git clone https://github.com/pranjaldayama/restassured-jenkins-cicd.git cd restassured-jenkins-cicd
-
Build & run tests locally
mvn clean test
-
Hook into Jenkins
Create a Maven job in Jenkins Point it to this repo Configure the build step as clean test Optionally add Allure or TestNG HTML report plugins for post-build reporting
Project Structure
βββ src/ β βββ main/java/ β Request payloads, helper utilities β βββ test/java/ β REST Assured test classes and TestNG suites βββ pom.xml β Build, dependencies & plugins βββ Jenkinsfile (optional) β Pipeline config for Jenkins Pipeline jobs
π οΈ Features & Best Practices
β Modular API tests with REST Assured + TestNG β Maven-automated lifecycle: compile β test β report β Optional Jenkinsfile for declarative pipeline CI β Generates build artifacts & test reports for traceability
π§© Jenkins Integration Tips
Use Jenkins Maven integration plugin (or Pipeline syntax) Define build step: mvn clean test Enable post-build report archiving (TestNG HTML or Allure) Automate via triggers: SCM polling, webhooks, or cron schedule