Skip to content

Commit b4fd66f

Browse files
committed
Merge branch '2.0.x'
Closes gh-829
2 parents ef6aa13 + ebe70a9 commit b4fd66f

File tree

45 files changed

+223
-232
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+223
-232
lines changed

docs/src/test/java/com/example/restassured/EveryTestPreprocessing.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public void setup() {
5050
}
5151
// end::setup[]
5252

53-
public void use() throws Exception {
53+
public void use() {
5454
// tag::use[]
5555
RestAssured.given(this.spec)
5656
.filter(document("index", links(linkWithRel("self").description("Canonical self link")))).when()

docs/src/test/java/com/example/restassured/HttpHeaders.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2021 the original author or authors.
2+
* Copyright 2014-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -29,7 +29,7 @@ public class HttpHeaders {
2929

3030
private RequestSpecification spec;
3131

32-
public void headers() throws Exception {
32+
public void headers() {
3333
// tag::headers[]
3434
RestAssured.given(this.spec).filter(document("headers", requestHeaders(// <1>
3535
headerWithName("Authorization").description("Basic auth credentials")), // <2>

docs/src/test/java/com/example/restassured/Hypermedia.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2021 the original author or authors.
2+
* Copyright 2014-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -29,7 +29,7 @@ public class Hypermedia {
2929

3030
private RequestSpecification spec;
3131

32-
public void defaultExtractor() throws Exception {
32+
public void defaultExtractor() {
3333
// tag::links[]
3434
RestAssured.given(this.spec).accept("application/json").filter(document("index", links(// <1>
3535
linkWithRel("alpha").description("Link to the alpha resource"), // <2>
@@ -38,7 +38,7 @@ public void defaultExtractor() throws Exception {
3838
// end::links[]
3939
}
4040

41-
public void explicitExtractor() throws Exception {
41+
public void explicitExtractor() {
4242
RestAssured.given(this.spec).accept("application/json")
4343
// tag::explicit-extractor[]
4444
.filter(document("index", links(halLinks(), // <1>

docs/src/test/java/com/example/restassured/InvokeService.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2021 the original author or authors.
2+
* Copyright 2014-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@ public class InvokeService {
2626

2727
private RequestSpecification spec;
2828

29-
public void invokeService() throws Exception {
29+
public void invokeService() {
3030
// tag::invoke-service[]
3131
RestAssured.given(this.spec) // <1>
3232
.accept("application/json") // <2>

docs/src/test/java/com/example/restassured/PathParameters.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2021 the original author or authors.
2+
* Copyright 2014-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@ public class PathParameters {
2828

2929
private RequestSpecification spec;
3030

31-
public void pathParametersSnippet() throws Exception {
31+
public void pathParametersSnippet() {
3232
// tag::path-parameters[]
3333
RestAssured.given(this.spec).filter(document("locations", pathParameters(// <1>
3434
parameterWithName("latitude").description("The location's latitude"), // <2>

docs/src/test/java/com/example/restassured/Payload.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2021 the original author or authors.
2+
* Copyright 2014-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -37,7 +37,7 @@ public class Payload {
3737

3838
private RequestSpecification spec;
3939

40-
public void response() throws Exception {
40+
public void response() {
4141
// tag::response[]
4242
RestAssured.given(this.spec).accept("application/json").filter(document("user", responseFields(// <1>
4343
fieldWithPath("contact.name").description("The user's name"), // <2>
@@ -46,7 +46,7 @@ public void response() throws Exception {
4646
// end::response[]
4747
}
4848

49-
public void subsection() throws Exception {
49+
public void subsection() {
5050
// tag::subsection[]
5151
RestAssured.given(this.spec).accept("application/json")
5252
.filter(document("user",
@@ -55,7 +55,7 @@ public void subsection() throws Exception {
5555
// end::subsection[]
5656
}
5757

58-
public void explicitType() throws Exception {
58+
public void explicitType() {
5959
RestAssured.given(this.spec).accept("application/json")
6060
// tag::explicit-type[]
6161
.filter(document("user", responseFields(fieldWithPath("contact.email").type(JsonFieldType.STRING) // <1>
@@ -64,7 +64,7 @@ public void explicitType() throws Exception {
6464
.when().get("/user/5").then().assertThat().statusCode(is(200));
6565
}
6666

67-
public void constraints() throws Exception {
67+
public void constraints() {
6868
RestAssured.given(this.spec).accept("application/json")
6969
// tag::constraints[]
7070
.filter(document("create-user",
@@ -77,7 +77,7 @@ public void constraints() throws Exception {
7777
.when().post("/users").then().assertThat().statusCode(is(200));
7878
}
7979

80-
public void descriptorReuse() throws Exception {
80+
public void descriptorReuse() {
8181
FieldDescriptor[] book = new FieldDescriptor[] { fieldWithPath("title").description("Title of the book"),
8282
fieldWithPath("author").description("Author of the book") };
8383

@@ -94,7 +94,7 @@ public void descriptorReuse() throws Exception {
9494
// end::book-array[]
9595
}
9696

97-
public void fieldsSubsection() throws Exception {
97+
public void fieldsSubsection() {
9898
// tag::fields-subsection[]
9999
RestAssured.given(this.spec).accept("application/json")
100100
.filter(document("location", responseFields(beneathPath("weather.temperature"), // <1>
@@ -104,7 +104,7 @@ public void fieldsSubsection() throws Exception {
104104
// end::fields-subsection[]
105105
}
106106

107-
public void bodySubsection() throws Exception {
107+
public void bodySubsection() {
108108
// tag::body-subsection[]
109109
RestAssured.given(this.spec).accept("application/json")
110110
.filter(document("location", responseBody(beneathPath("weather.temperature")))) // <1>

docs/src/test/java/com/example/restassured/PerTestPreprocessing.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class PerTestPreprocessing {
3030

3131
private RequestSpecification spec;
3232

33-
public void general() throws Exception {
33+
public void general() {
3434
// tag::preprocessing[]
3535
RestAssured.given(this.spec).filter(document("index", preprocessRequest(modifyHeaders().remove("Foo")), // <1>
3636
preprocessResponse(prettyPrint()))) // <2>

docs/src/test/java/com/example/restassured/RequestParameters.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2021 the original author or authors.
2+
* Copyright 2014-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@ public class RequestParameters {
2828

2929
private RequestSpecification spec;
3030

31-
public void getQueryStringSnippet() throws Exception {
31+
public void getQueryStringSnippet() {
3232
// tag::request-parameters-query-string[]
3333
RestAssured.given(this.spec).filter(document("users", requestParameters(// <1>
3434
parameterWithName("page").description("The page to retrieve"), // <2>
@@ -38,7 +38,7 @@ public void getQueryStringSnippet() throws Exception {
3838
// end::request-parameters-query-string[]
3939
}
4040

41-
public void postFormDataSnippet() throws Exception {
41+
public void postFormDataSnippet() {
4242
// tag::request-parameters-form-data[]
4343
RestAssured.given(this.spec)
4444
.filter(document("create-user",

docs/src/test/java/com/example/restassured/RequestPartPayload.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2021 the original author or authors.
2+
* Copyright 2014-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -33,7 +33,7 @@ public class RequestPartPayload {
3333

3434
private RequestSpecification spec;
3535

36-
public void fields() throws Exception {
36+
public void fields() {
3737
// tag::fields[]
3838
Map<String, String> metadata = new HashMap<>();
3939
metadata.put("version", "1.0");
@@ -45,7 +45,7 @@ public void fields() throws Exception {
4545
// end::fields[]
4646
}
4747

48-
public void body() throws Exception {
48+
public void body() {
4949
// tag::body[]
5050
Map<String, String> metadata = new HashMap<>();
5151
metadata.put("version", "1.0");

docs/src/test/java/com/example/restassured/RequestParts.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2021 the original author or authors.
2+
* Copyright 2014-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@ public class RequestParts {
2828

2929
private RequestSpecification spec;
3030

31-
public void upload() throws Exception {
31+
public void upload() {
3232
// tag::request-parts[]
3333
RestAssured.given(this.spec).filter(document("users", requestParts(// <1>
3434
partWithName("file").description("The file to upload")))) // <2>

docs/src/test/java/com/example/restassured/RestAssuredSnippetReuse.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2021 the original author or authors.
2+
* Copyright 2014-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@ public class RestAssuredSnippetReuse extends SnippetReuse {
2828

2929
private RequestSpecification spec;
3030

31-
public void documentation() throws Exception {
31+
public void documentation() {
3232
// tag::use[]
3333
RestAssured.given(this.spec).accept("application/json").filter(document("example", this.pagingLinks.and(// <1>
3434
linkWithRel("alpha").description("Link to the alpha resource"),

docs/src/test/java/com/example/webtestclient/EveryTestPreprocessing.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void setup() {
5454
}
5555
// end::setup[]
5656

57-
public void use() throws Exception {
57+
public void use() {
5858
// tag::use[]
5959
this.webTestClient.get().uri("/").exchange().expectStatus().isOk()
6060
.expectBody().consumeWith(document("index",

docs/src/test/java/com/example/webtestclient/HttpHeaders.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2017 the original author or authors.
2+
* Copyright 2014-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -29,7 +29,7 @@ public class HttpHeaders {
2929

3030
private WebTestClient webTestClient;
3131

32-
public void headers() throws Exception {
32+
public void headers() {
3333
// tag::headers[]
3434
this.webTestClient
3535
.get().uri("/people").header("Authorization", "Basic dXNlcjpzZWNyZXQ=") // <1>

docs/src/test/java/com/example/webtestclient/Hypermedia.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2021 the original author or authors.
2+
* Copyright 2014-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@ public class Hypermedia {
2828

2929
private WebTestClient webTestClient;
3030

31-
public void defaultExtractor() throws Exception {
31+
public void defaultExtractor() {
3232
// tag::links[]
3333
this.webTestClient.get().uri("/").accept(MediaType.APPLICATION_JSON).exchange().expectStatus().isOk()
3434
.expectBody().consumeWith(document("index", links(// <1>
@@ -37,7 +37,7 @@ public void defaultExtractor() throws Exception {
3737
// end::links[]
3838
}
3939

40-
public void explicitExtractor() throws Exception {
40+
public void explicitExtractor() {
4141
this.webTestClient.get().uri("/").accept(MediaType.APPLICATION_JSON).exchange().expectStatus().isOk()
4242
.expectBody()
4343
// tag::explicit-extractor[]

docs/src/test/java/com/example/webtestclient/InvokeService.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2017 the original author or authors.
2+
* Copyright 2014-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@ public class InvokeService {
2525

2626
private WebTestClient webTestClient;
2727

28-
public void invokeService() throws Exception {
28+
public void invokeService() {
2929
// tag::invoke-service[]
3030
this.webTestClient.get().uri("/").accept(MediaType.APPLICATION_JSON) // <1>
3131
.exchange().expectStatus().isOk() // <2>

docs/src/test/java/com/example/webtestclient/PathParameters.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2017 the original author or authors.
2+
* Copyright 2014-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@ public class PathParameters {
2828

2929
private WebTestClient webTestClient;
3030

31-
public void pathParametersSnippet() throws Exception {
31+
public void pathParametersSnippet() {
3232
// tag::path-parameters[]
3333
this.webTestClient.get().uri("/locations/{latitude}/{longitude}", 51.5072, 0.1275) // <1>
3434
.exchange().expectStatus().isOk().expectBody()

docs/src/test/java/com/example/webtestclient/Payload.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2017 the original author or authors.
2+
* Copyright 2014-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -37,7 +37,7 @@ public class Payload {
3737

3838
private WebTestClient webTestClient;
3939

40-
public void response() throws Exception {
40+
public void response() {
4141
// tag::response[]
4242
this.webTestClient.get().uri("user/5").accept(MediaType.APPLICATION_JSON)
4343
.exchange().expectStatus().isOk().expectBody()
@@ -48,7 +48,7 @@ public void response() throws Exception {
4848
// end::response[]
4949
}
5050

51-
public void subsection() throws Exception {
51+
public void subsection() {
5252
// tag::subsection[]
5353
this.webTestClient.get().uri("user/5").accept(MediaType.APPLICATION_JSON)
5454
.exchange().expectStatus().isOk().expectBody()
@@ -58,7 +58,7 @@ public void subsection() throws Exception {
5858
// end::subsection[]
5959
}
6060

61-
public void explicitType() throws Exception {
61+
public void explicitType() {
6262
this.webTestClient.get().uri("user/5").accept(MediaType.APPLICATION_JSON)
6363
.exchange().expectStatus().isOk().expectBody()
6464
// tag::explicit-type[]
@@ -70,7 +70,7 @@ public void explicitType() throws Exception {
7070
// end::explicit-type[]
7171
}
7272

73-
public void constraints() throws Exception {
73+
public void constraints() {
7474
this.webTestClient.get().uri("user/5").accept(MediaType.APPLICATION_JSON)
7575
.exchange().expectStatus().isOk().expectBody()
7676
// tag::constraints[]
@@ -86,7 +86,7 @@ public void constraints() throws Exception {
8686
// end::constraints[]
8787
}
8888

89-
public void descriptorReuse() throws Exception {
89+
public void descriptorReuse() {
9090
FieldDescriptor[] book = new FieldDescriptor[] {
9191
fieldWithPath("title").description("Title of the book"),
9292
fieldWithPath("author").description("Author of the book") };
@@ -109,7 +109,7 @@ public void descriptorReuse() throws Exception {
109109
// end::book-array[]
110110
}
111111

112-
public void fieldsSubsection() throws Exception {
112+
public void fieldsSubsection() {
113113
// tag::fields-subsection[]
114114
this.webTestClient.get().uri("/locations/1").accept(MediaType.APPLICATION_JSON)
115115
.exchange().expectStatus().isOk().expectBody()
@@ -120,7 +120,7 @@ public void fieldsSubsection() throws Exception {
120120
// end::fields-subsection[]
121121
}
122122

123-
public void bodySubsection() throws Exception {
123+
public void bodySubsection() {
124124
// tag::body-subsection[]
125125
this.webTestClient.get().uri("/locations/1").accept(MediaType.APPLICATION_JSON)
126126
.exchange().expectStatus().isOk().expectBody()

0 commit comments

Comments
 (0)