forked from codacytesteuser/CheckPrCommentsPublicProjectDev
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcode1.txt
More file actions
42 lines (32 loc) · 1.11 KB
/
code1.txt
File metadata and controls
42 lines (32 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package TestFramework;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
import static io.restassured.RestAssured.given;
import static org.hamcrest.Matchers.equalTo;
import org.testng.annotations.Test;
public class basics {
@Test
public void getPlaceAPI()
{
// TODO Auto-generated method stub
//BaseURL or Host
RestAssured.baseURI="https://maps.googleapis.com";
given().
param("location","-33.8670522,151.1957362").
param("radius","500").
param("key","AIzaSyDIQgAh0B4p0SdyYkyW8tlG-y0yJMfss5Y").
when().
get("/maps/api/place/nearbysearch/json").
then().assertThat().statusCode(200).and().contentType(ContentType.JSON).and().
body("results[0].name",equalTo("Sydney")).and().
body("results[0].place_id", equalTo("ChIJP3Sa8ziYEmsRUKgyFmh9AQM")).and().
header("Server","pablo");
/*header("dfd","fsdfds").
cookie("dsfs","csder").
body()*/
//Status code of the response
//Content type
//Body
//Header responses
}
}