Created
April 17, 2016 11:36
-
-
Save magnuspalmer/52a9e16af89cda1a9ccd0a5b5bdc7edb to your computer and use it in GitHub Desktop.
RestAssured ContentLength
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Grapes([ | |
@Grab('com.jayway.restassured:rest-assured:2.9.0'), | |
@GrabExclude(group = 'org.codehaus.groovy', module='groovy-all'), | |
@GrabExclude(group = 'org.codehaus.groovy', module='groovy-xml') | |
]) | |
import static com.jayway.restassured.RestAssured.* | |
import static com.jayway.restassured.matcher.RestAssuredMatchers.* | |
import static org.hamcrest.Matchers.* | |
import static com.jayway.restassured.config.RestAssuredConfig.* | |
import com.jayway.restassured.RestAssured | |
import com.jayway.restassured.config.* | |
import com.jayway.restassured.config.RestAssuredConfig.* | |
RestAssured.baseURI = "http://jsonplaceholder.typicode.com" | |
given() | |
.log().all() | |
.param('userId', '1') | |
.header("User-Agent", "GroovyConsole") | |
.when() | |
.get("/posts") | |
.then() | |
.statusCode(200) | |
.log().all() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment