DEV Community

Cover image for Rest Assured E2E Testing - Part 3
TaheraFirdose
TaheraFirdose

Posted on

Rest Assured E2E Testing - Part 3

Setup A Basic REST Assured Maven Project In Eclipse IDE

In this post we will learn to setup a Maven – REST Assured in Eclipse IDE.

Pre-requisites

To begin your project, you must have the following installed and configured on your computer.
Java and Eclipse IDE •
TestNG which is unit testing framework •
Maven (either we can add jar file manually to our project or we can create a maven project)

Lest’s get started with creating the project.

Creating Maven Project in Eclipse

  1. Open eclipse and click on File> New> Project
    image

  2. In the wizard text box, type Maven and then select Maven from the list box, as shown below. Click the Next> button.

image

  1. Click on Next button(select maven-archetype-quickstart)
    image

  2. Type in the Group Id and Artifact Id (You can give any name to that) and click Finish button
    image

  3. Finally, the Maven Project “RESTAssured_APITesting” is successfully created. Please keep in mind that this Maven project generates pom.xml, as highlighted and shown below.
    image

  4. Add dependency of rest assured in pom.xml. For getting maven dependency, visit Maven Repository.

    image

  5. Add Maven dependency of TestNG/Junit in your framework. These tests framework will help in managing tests. TestNG is preferable as compared to Junit because of additional features in TestNG. You can copy the dependency from Maven Repository and then paste it in pom.xml.

image

  1. Add Maven dependency of Jackson JSON java parser and JSON Schema Validator in pom.xml. JSON Schema Validator will be used to validate JSON Schema while JSON java parser will be used for parse JSON to map java objects to and from JSON. image

image

  1. Install hamcrest Assertion
    image

  2. After adding all the dependencies, the final pom.xml will look just like below.
    image

  3. After successful addition of dependencies, you will see JAR files in Maven dependencies in your project structure.

image

DevCycle image

OpenFeature Multi-Provider: Enabling New Feature Flagging Use-Cases

DevCycle is the first feature management platform with OpenFeature built in. We pair the reliability, scalability, and security of a managed service with freedom from vendor lock-in, helping developers ship faster with true OpenFeature-native feature flagging.

Watch Full Video 🎥

Top comments (0)

Dev Diairies image

User Feedback & The Pivot That Saved The Project

🔥 Check out Episode 3 of Dev Diairies, following a successful Hackathon project turned startup.

Watch full video 🎥

👋 Kindness is contagious

Embark on this engaging article, highly regarded by the DEV Community. Whether you're a newcomer or a seasoned pro, your contributions help us grow together.

A heartfelt "thank you" can make someone’s day—drop your kudos below!

On DEV, sharing insights ignites innovation and strengthens our bonds. If this post resonated with you, a quick note of appreciation goes a long way.

Get Started