1
1
/*
2
- * Copyright 2014-2021 the original author or authors.
2
+ * Copyright 2014-2022 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -37,7 +37,7 @@ public class Payload {
37
37
38
38
private RequestSpecification spec ;
39
39
40
- public void response () throws Exception {
40
+ public void response () {
41
41
// tag::response[]
42
42
RestAssured .given (this .spec ).accept ("application/json" ).filter (document ("user" , responseFields (// <1>
43
43
fieldWithPath ("contact.name" ).description ("The user's name" ), // <2>
@@ -46,7 +46,7 @@ public void response() throws Exception {
46
46
// end::response[]
47
47
}
48
48
49
- public void subsection () throws Exception {
49
+ public void subsection () {
50
50
// tag::subsection[]
51
51
RestAssured .given (this .spec ).accept ("application/json" )
52
52
.filter (document ("user" ,
@@ -55,7 +55,7 @@ public void subsection() throws Exception {
55
55
// end::subsection[]
56
56
}
57
57
58
- public void explicitType () throws Exception {
58
+ public void explicitType () {
59
59
RestAssured .given (this .spec ).accept ("application/json" )
60
60
// tag::explicit-type[]
61
61
.filter (document ("user" , responseFields (fieldWithPath ("contact.email" ).type (JsonFieldType .STRING ) // <1>
@@ -64,7 +64,7 @@ public void explicitType() throws Exception {
64
64
.when ().get ("/user/5" ).then ().assertThat ().statusCode (is (200 ));
65
65
}
66
66
67
- public void constraints () throws Exception {
67
+ public void constraints () {
68
68
RestAssured .given (this .spec ).accept ("application/json" )
69
69
// tag::constraints[]
70
70
.filter (document ("create-user" ,
@@ -77,7 +77,7 @@ public void constraints() throws Exception {
77
77
.when ().post ("/users" ).then ().assertThat ().statusCode (is (200 ));
78
78
}
79
79
80
- public void descriptorReuse () throws Exception {
80
+ public void descriptorReuse () {
81
81
FieldDescriptor [] book = new FieldDescriptor [] { fieldWithPath ("title" ).description ("Title of the book" ),
82
82
fieldWithPath ("author" ).description ("Author of the book" ) };
83
83
@@ -94,7 +94,7 @@ public void descriptorReuse() throws Exception {
94
94
// end::book-array[]
95
95
}
96
96
97
- public void fieldsSubsection () throws Exception {
97
+ public void fieldsSubsection () {
98
98
// tag::fields-subsection[]
99
99
RestAssured .given (this .spec ).accept ("application/json" )
100
100
.filter (document ("location" , responseFields (beneathPath ("weather.temperature" ), // <1>
@@ -104,7 +104,7 @@ public void fieldsSubsection() throws Exception {
104
104
// end::fields-subsection[]
105
105
}
106
106
107
- public void bodySubsection () throws Exception {
107
+ public void bodySubsection () {
108
108
// tag::body-subsection[]
109
109
RestAssured .given (this .spec ).accept ("application/json" )
110
110
.filter (document ("location" , responseBody (beneathPath ("weather.temperature" )))) // <1>
0 commit comments