Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 10 additions & 65 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,87 +9,32 @@ on:
- master
- issue-*

permissions:
contents: write

jobs:
build_and_test:
name: Build and Test
runs-on: ubuntu-latest

steps:
- name: checkout Git repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Java and Maven
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: '15'
java-version: '21'
distribution: 'adopt'
cache: maven

- name: Build the Project
run: mvn clean install -DskipTests

- name: Test Execution
run: mvn org.jacoco:jacoco-maven-plugin:prepare-agent install -Pcoverage-per-test

- name: Upload target folder
uses: actions/upload-artifact@v2
with:
name: target
path: |
${{ github.workspace }}/target
${{ github.workspace }}/reports
code_analysis:
name: Code Analysis
needs:
- build_and_test

runs-on: ubuntu-latest

steps:
- name: checkout Git repository
uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Install Java and Maven
uses: actions/setup-java@v2
with:
java-version: '15'
distribution: 'adopt'
cache: maven

- name: Cache SonarCloud packages
uses: actions/cache@v2
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Download target folder
uses: actions/download-artifact@v2
with:
name: target
- name: Build the Project and run tests
run: mvn clean install

- name: Sonar Code Analysis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_KEY: ${{ secrets.SONAR_KEY }}
run: |
mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
-Dsonar.projectKey=$SONAR_KEY
- name: Test Report
uses: dorny/test-reporter@v1
uses: dorny/test-reporter@v2
if: success() || failure()
with:
name: Test Results
path: ${{ github.workspace }}/target/surefire-reports/TEST-TestSuite.xml
reporter: java-junit
java-version: 11
reporter: java-junit
50 changes: 40 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,40 @@
/target/
/test-output/
/settings/
/reports/
/logs/
/.settings/
/.classpath
/.project
/.idea/
/*.iml/
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
test-output/

### IntelliJ IDEA ###
.idea/
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store
44 changes: 25 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@

![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Github Actions Workflow](https://github.com/mfaisalkhatri/OkHttpRestAssuredExamples/actions/workflows/maven.yml/badge.svg)](https://github.com/mfaisalkhatri/OkHttpRestAssuredExamples/actions/workflows/maven.yml)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=mfaisalkhatri_OkHttpRestAssuredExamples&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=mfaisalkhatri_OkHttpRestAssuredExamples)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=mfaisalkhatri_OkHttpRestAssuredExamples&metric=coverage)](https://sonarcloud.io/summary/new_code?id=mfaisalkhatri_OkHttpRestAssuredExamples)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=mfaisalkhatri_OkHttpRestAssuredExamples&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=mfaisalkhatri_OkHttpRestAssuredExamples)
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=mfaisalkhatri_OkHttpRestAssuredExamples&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=mfaisalkhatri_OkHttpRestAssuredExamples)


## Don't forget to give a :star: to make the project popular.

Expand All @@ -17,10 +11,9 @@ I heard a lot about Rest-Assured and OkHttp and how it made the QA's life easier

Hence, I started learning about these frameworks and have documented all my learnings in this repository.

Checkout my blog [API Testing using RestAssured and OkHttp][blog] where I talk about these frameworks in details
Checkout my blog [API Testing using RestAssured and OkHttp](https://mfaisalkhatri.github.io/2020/05/29/restassuredokhttp/) where I talk about these frameworks in details
and which one to choose for testing your APIs.

To get a better understanding on API Testing, check [What is API Testing?][blog_apitesting]

## Details about this Project:

Expand All @@ -31,18 +24,31 @@ To get a better understanding on API Testing, check [What is API Testing?][blog_
- Lombok has been used to generate Getter and Setters automatically for post body requests.
- Rest APIs on https://reqres.in/ have been used for testing.

## :writing_hand: Blog Links

- [What is API Testing?](https://mfaisalkhatri.github.io/2020/08/08/apitesting/)
- [End to End API Testing using Rest-Assured](https://medium.com/@iamfaisalkhatri/end-to-end-api-testing-using-rest-assured-a58c4ea80255)

## :movie_camera: Tutorial Video

[![Watch the video](https://img.youtube.com/vi/xLKpdQE0oKY/hqdefault.jpg)](https://www.youtube.com/watch?v=xLKpdQE0oKY&t=1s)
[![Watch the video](https://img.youtube.com/vi/AFQSolEeu74/hqdefault.jpg)](https://www.youtube.com/live/AFQSolEeu74?si=8WROMbunjUuzqqQj&t=1)


## :question: Need Assistance?

- Discuss your queries by writing to me at [mohammadfaisalkhatri@gmail.com][mail] or you can ping me on the following social media sites:
- Twitter: [mfaisal_khatri][twitter]
- LinkedIn: [Mohammad Faisal Khatri][linkedin]
- Contact me for 1:1 trainings related to Test Automation.
- Discuss your queries by writing to me @ `mohammadfaisalkhatri@gmail.com`
OR ping me on any of the social media sites using the below link:
- [Linktree](https://linktr.ee/faisalkhatri)

## :computer: Paid Trainings

Contact me for Paid trainings related to Test Automation and Software Testing,
mail me @`mohammadfaisalkhatri@gmail.com` or ping me on [LinkedIn](https://www.linkedin.com/in/faisalkhatri/)

## :thought_balloon: Checkout the blogs related to Testing on my [website][]
## :thought_balloon: Checkout the blogs related to Software Testing and Test Automation on the following links:
- [Medium Blogs](https://medium.com/@iamfaisalkhatri)
- [LambdaTest Blogs](https://www.lambdatest.com/blog/author/mfaisalkhatri/)
- [My Website](https://mfaisalkhatri.github.io)

[mail]: mohammadfaisalkhatri@gmail.com
[linkedin]: https://www.linkedin.com/in/faisalkhatri/
[twitter]: https://twitter.com/mfaisal_khatri
[website]: https://mfaisalkhatri.github.io
[blog]: https://mfaisalkhatri.github.io/2020/05/29/restassuredokhttp/
[blog_apitesting]: https://mfaisalkhatri.github.io/2020/08/08/apitesting/
## Subscribe to my [YouTube Channel](https://www.youtube.com/@faisalkhatriqa)
58 changes: 0 additions & 58 deletions okhttppoc.iml

This file was deleted.

Loading