Sunday 24 November 2019

RestAssured: Set up the maven project


Step 1: Create new maven project in Eclipse.

Open Eclipse.

File -> New -> Other.


Search for maven. Select ‘Maven Project’, click on Next button.

Select the check box ‘Create a simple project (skip archetype selection)./ Click on Next button.

Fill below details.
Group id: com.sample.app
artifactId: restAssuredDemo
version: 1

Click on Finish button.

Total project structure looks like below.


Update pom.xml with maven dependencies.

I am using below maven dependency.
 <dependencies>
  <dependency>
   <groupId>io.rest-assured</groupId>
   <artifactId>rest-assured</artifactId>
   <version>4.1.1</version>
  </dependency>

  <dependency>
   <groupId>com.fasterxml.jackson.core</groupId>
   <artifactId>jackson-databind</artifactId>
   <version>2.10.0</version>
  </dependency>

  <dependency>
   <groupId>junit</groupId>
   <artifactId>junit</artifactId>
   <version>4.12</version>
  </dependency>


 </dependencies>


pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 <modelVersion>4.0.0</modelVersion>
 <groupId>com.sample.app</groupId>
 <artifactId>restAssuredDemo</artifactId>
 <version>1</version>

 <dependencies>
  <dependency>
   <groupId>io.rest-assured</groupId>
   <artifactId>rest-assured</artifactId>
   <version>4.1.1</version>
  </dependency>

  <dependency>
   <groupId>com.fasterxml.jackson.core</groupId>
   <artifactId>jackson-databind</artifactId>
   <version>2.10.0</version>
  </dependency>

  <dependency>
   <groupId>junit</groupId>
   <artifactId>junit</artifactId>
   <version>4.12</version>
  </dependency>


 </dependencies>

</project>




Previous                                                    Next                                                    Home

No comments:

Post a Comment