File tree 9 files changed +27
-27
lines changed
docs/src/test/java/com/example
9 files changed +27
-27
lines changed Original file line number Diff line number Diff line change 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.
25
25
import org .springframework .web .context .WebApplicationContext ;
26
26
27
27
import static org .springframework .restdocs .mockmvc .MockMvcRestDocumentation .documentationConfiguration ;
28
+ import static org .springframework .restdocs .operation .preprocess .Preprocessors .modifyHeaders ;
28
29
import static org .springframework .restdocs .operation .preprocess .Preprocessors .prettyPrint ;
29
- import static org .springframework .restdocs .operation .preprocess .Preprocessors .removeHeaders ;
30
30
31
31
public class CustomDefaultOperationPreprocessors {
32
32
@@ -43,7 +43,7 @@ public void setup() {
43
43
// tag::custom-default-operation-preprocessors[]
44
44
this .mockMvc = MockMvcBuilders .webAppContextSetup (this .context )
45
45
.apply (documentationConfiguration (this .restDocumentation ).operationPreprocessors ()
46
- .withRequestDefaults (removeHeaders ("Foo" )) // <1>
46
+ .withRequestDefaults (modifyHeaders (). remove ("Foo" )) // <1>
47
47
.withResponseDefaults (prettyPrint ())) // <2>
48
48
.build ();
49
49
// end::custom-default-operation-preprocessors[]
Original file line number Diff line number Diff line change 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.
29
29
import static org .springframework .restdocs .mockmvc .MockMvcRestDocumentation .document ;
30
30
import static org .springframework .restdocs .mockmvc .MockMvcRestDocumentation .documentationConfiguration ;
31
31
import static org .springframework .restdocs .mockmvc .RestDocumentationRequestBuilders .get ;
32
+ import static org .springframework .restdocs .operation .preprocess .Preprocessors .modifyHeaders ;
32
33
import static org .springframework .restdocs .operation .preprocess .Preprocessors .prettyPrint ;
33
- import static org .springframework .restdocs .operation .preprocess .Preprocessors .removeHeaders ;
34
34
import static org .springframework .test .web .servlet .result .MockMvcResultMatchers .status ;
35
35
36
36
public class EveryTestPreprocessing {
@@ -47,7 +47,7 @@ public class EveryTestPreprocessing {
47
47
public void setup () {
48
48
this .mockMvc = MockMvcBuilders .webAppContextSetup (this .context )
49
49
.apply (documentationConfiguration (this .restDocumentation ).operationPreprocessors ()
50
- .withRequestDefaults (removeHeaders ("Foo" )) // <1>
50
+ .withRequestDefaults (modifyHeaders (). remove ("Foo" )) // <1>
51
51
.withResponseDefaults (prettyPrint ())) // <2>
52
52
.build ();
53
53
}
Original file line number Diff line number Diff line change 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.
20
20
21
21
import static org .springframework .restdocs .mockmvc .MockMvcRestDocumentation .document ;
22
22
import static org .springframework .restdocs .mockmvc .RestDocumentationRequestBuilders .get ;
23
+ import static org .springframework .restdocs .operation .preprocess .Preprocessors .modifyHeaders ;
23
24
import static org .springframework .restdocs .operation .preprocess .Preprocessors .preprocessRequest ;
24
25
import static org .springframework .restdocs .operation .preprocess .Preprocessors .preprocessResponse ;
25
26
import static org .springframework .restdocs .operation .preprocess .Preprocessors .prettyPrint ;
26
- import static org .springframework .restdocs .operation .preprocess .Preprocessors .removeHeaders ;
27
27
import static org .springframework .test .web .servlet .result .MockMvcResultMatchers .status ;
28
28
29
29
public class PerTestPreprocessing {
@@ -33,7 +33,7 @@ public class PerTestPreprocessing {
33
33
public void general () throws Exception {
34
34
// tag::preprocessing[]
35
35
this .mockMvc .perform (get ("/" )).andExpect (status ().isOk ())
36
- .andDo (document ("index" , preprocessRequest (removeHeaders ("Foo" )), // <1>
36
+ .andDo (document ("index" , preprocessRequest (modifyHeaders (). remove ("Foo" )), // <1>
37
37
preprocessResponse (prettyPrint ()))); // <2>
38
38
// end::preprocessing[]
39
39
}
Original file line number Diff line number Diff line change 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.
23
23
24
24
import org .springframework .restdocs .JUnitRestDocumentation ;
25
25
26
+ import static org .springframework .restdocs .operation .preprocess .Preprocessors .modifyHeaders ;
26
27
import static org .springframework .restdocs .operation .preprocess .Preprocessors .prettyPrint ;
27
- import static org .springframework .restdocs .operation .preprocess .Preprocessors .removeHeaders ;
28
28
import static org .springframework .restdocs .restassured .RestAssuredRestDocumentation .documentationConfiguration ;
29
29
30
30
public class CustomDefaultOperationPreprocessors {
@@ -40,7 +40,7 @@ public void setup() {
40
40
// tag::custom-default-operation-preprocessors[]
41
41
this .spec = new RequestSpecBuilder ()
42
42
.addFilter (documentationConfiguration (this .restDocumentation ).operationPreprocessors ()
43
- .withRequestDefaults (removeHeaders ("Foo" )) // <1>
43
+ .withRequestDefaults (modifyHeaders (). remove ("Foo" )) // <1>
44
44
.withResponseDefaults (prettyPrint ())) // <2>
45
45
.build ();
46
46
// end::custom-default-operation-preprocessors[]
Original file line number Diff line number Diff line change 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.
27
27
import static org .hamcrest .CoreMatchers .is ;
28
28
import static org .springframework .restdocs .hypermedia .HypermediaDocumentation .linkWithRel ;
29
29
import static org .springframework .restdocs .hypermedia .HypermediaDocumentation .links ;
30
+ import static org .springframework .restdocs .operation .preprocess .Preprocessors .modifyHeaders ;
30
31
import static org .springframework .restdocs .operation .preprocess .Preprocessors .prettyPrint ;
31
- import static org .springframework .restdocs .operation .preprocess .Preprocessors .removeHeaders ;
32
32
import static org .springframework .restdocs .restassured .RestAssuredRestDocumentation .document ;
33
33
import static org .springframework .restdocs .restassured .RestAssuredRestDocumentation .documentationConfiguration ;
34
34
@@ -44,7 +44,7 @@ public class EveryTestPreprocessing {
44
44
public void setup () {
45
45
this .spec = new RequestSpecBuilder ()
46
46
.addFilter (documentationConfiguration (this .restDocumentation ).operationPreprocessors ()
47
- .withRequestDefaults (removeHeaders ("Foo" )) // <1>
47
+ .withRequestDefaults (modifyHeaders (). remove ("Foo" )) // <1>
48
48
.withResponseDefaults (prettyPrint ())) // <2>
49
49
.build ();
50
50
}
Original file line number Diff line number Diff line change 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.
20
20
import io .restassured .specification .RequestSpecification ;
21
21
22
22
import static org .hamcrest .CoreMatchers .is ;
23
+ import static org .springframework .restdocs .operation .preprocess .Preprocessors .modifyHeaders ;
23
24
import static org .springframework .restdocs .operation .preprocess .Preprocessors .preprocessRequest ;
24
25
import static org .springframework .restdocs .operation .preprocess .Preprocessors .preprocessResponse ;
25
26
import static org .springframework .restdocs .operation .preprocess .Preprocessors .prettyPrint ;
26
- import static org .springframework .restdocs .operation .preprocess .Preprocessors .removeHeaders ;
27
27
import static org .springframework .restdocs .restassured .RestAssuredRestDocumentation .document ;
28
28
29
29
public class PerTestPreprocessing {
@@ -32,7 +32,7 @@ public class PerTestPreprocessing {
32
32
33
33
public void general () throws Exception {
34
34
// tag::preprocessing[]
35
- RestAssured .given (this .spec ).filter (document ("index" , preprocessRequest (removeHeaders ("Foo" )), // <1>
35
+ RestAssured .given (this .spec ).filter (document ("index" , preprocessRequest (modifyHeaders (). remove ("Foo" )), // <1>
36
36
preprocessResponse (prettyPrint ()))) // <2>
37
37
.when ().get ("/" ).then ().assertThat ().statusCode (is (200 ));
38
38
// end::preprocessing[]
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2014-2019 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.
23
23
import org .springframework .restdocs .JUnitRestDocumentation ;
24
24
import org .springframework .test .web .reactive .server .WebTestClient ;
25
25
26
+ import static org .springframework .restdocs .operation .preprocess .Preprocessors .modifyHeaders ;
26
27
import static org .springframework .restdocs .operation .preprocess .Preprocessors .prettyPrint ;
27
- import static org .springframework .restdocs .operation .preprocess .Preprocessors .removeHeaders ;
28
28
import static org .springframework .restdocs .webtestclient .WebTestClientRestDocumentation .documentationConfiguration ;
29
29
30
30
public class CustomDefaultOperationPreprocessors {
@@ -46,7 +46,7 @@ public void setup() {
46
46
.configureClient ()
47
47
.filter (documentationConfiguration (this .restDocumentation )
48
48
.operationPreprocessors ()
49
- .withRequestDefaults (removeHeaders ("Foo" )) // <1>
49
+ .withRequestDefaults (modifyHeaders (). remove ("Foo" )) // <1>
50
50
.withResponseDefaults (prettyPrint ())) // <2>
51
51
.build ();
52
52
// end::custom-default-operation-preprocessors[]
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2014-2019 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.
25
25
26
26
import static org .springframework .restdocs .hypermedia .HypermediaDocumentation .linkWithRel ;
27
27
import static org .springframework .restdocs .hypermedia .HypermediaDocumentation .links ;
28
+ import static org .springframework .restdocs .operation .preprocess .Preprocessors .modifyHeaders ;
28
29
import static org .springframework .restdocs .operation .preprocess .Preprocessors .prettyPrint ;
29
- import static org .springframework .restdocs .operation .preprocess .Preprocessors .removeHeaders ;
30
30
import static org .springframework .restdocs .webtestclient .WebTestClientRestDocumentation .document ;
31
31
import static org .springframework .restdocs .webtestclient .WebTestClientRestDocumentation .documentationConfiguration ;
32
32
@@ -48,7 +48,7 @@ public void setup() {
48
48
.configureClient ()
49
49
.filter (documentationConfiguration (this .restDocumentation )
50
50
.operationPreprocessors ()
51
- .withRequestDefaults (removeHeaders ("Foo" )) // <1>
51
+ .withRequestDefaults (modifyHeaders (). remove ("Foo" )) // <1>
52
52
.withResponseDefaults (prettyPrint ())) // <2>
53
53
.build ();
54
54
}
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2014-2017 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.
18
18
19
19
import org .springframework .test .web .reactive .server .WebTestClient ;
20
20
21
+ import static org .springframework .restdocs .operation .preprocess .Preprocessors .modifyHeaders ;
21
22
import static org .springframework .restdocs .operation .preprocess .Preprocessors .preprocessRequest ;
22
23
import static org .springframework .restdocs .operation .preprocess .Preprocessors .preprocessResponse ;
23
24
import static org .springframework .restdocs .operation .preprocess .Preprocessors .prettyPrint ;
24
- import static org .springframework .restdocs .operation .preprocess .Preprocessors .removeHeaders ;
25
25
import static org .springframework .restdocs .webtestclient .WebTestClientRestDocumentation .document ;
26
26
27
27
public class PerTestPreprocessing {
@@ -34,7 +34,7 @@ public void general() {
34
34
// tag::preprocessing[]
35
35
this .webTestClient .get ().uri ("/" ).exchange ().expectStatus ().isOk ().expectBody ()
36
36
.consumeWith (document ("index" ,
37
- preprocessRequest (removeHeaders ("Foo" )), // <1>
37
+ preprocessRequest (modifyHeaders (). remove ("Foo" )), // <1>
38
38
preprocessResponse (prettyPrint ()))); // <2>
39
39
// end::preprocessing[]
40
40
}
You can’t perform that action at this time.
0 commit comments