Configuring REST Assured with Gradle

Gradle is one of the widely used build automation tool nowadays. In this tutorial, we're talking about configuring the REST Assured libraries with the Gradle tool. This build tool would definitely save the time for configuring the selenium libraries manually 


As a first step, you need to create a blank Gradle project and this can be done via your IDE for eg: Eclipse. Once you created, you need to find the build file build.gradle under the Gradle project. In this file, we need to mention the required REST Assured libraries. Please look into the a sample build.gradle file, here you can see the required depedencies added under the section dependencies. When you build the project after this, you can see that all configured librareis got downloaded under the project and it saves the time for configuring the libraries manually !!

plugins {
// Apply the java-library plugin to add support for Java Library
id 'java-library'
}
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.commons:commons-math3:3.6.1'
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:28.0-jre'
// Use JUnit test framework
testImplementation 'junit:junit:4.12'
// https://bintray.com/bintray/jcenter/io.rest-assured%3Arest-assured
implementation 'io.rest-assured:rest-assured:4.3.2'
// https://bintray.com/bintray/jcenter/org.testng:testng
implementation 'org.testng:testng:6.9.6'
// https://bintray.com/bintray/jcenter/io.rest-assured%3Ajson-path
implementation 'io.rest-assured:json-path:4.3.2'
}
view raw build.gradle hosted with ❤ by GitHub


Previous Post Next Post