This repository was archived by the owner on Dec 19, 2023. It is now read-only.
Commit a75c772
Fixed missing handler method on error (WebTestClient) (#250)
The current implementation of `WebTestClientInitializer` only works if the rest endpoint succeeds. In case of an error (for example passing an `String` as `PathVariable` of type `int`) the handler method is not determined correctly and this leads for example to a missing headline in the `auto-section.adoc`.
The reason is that spring webflux `DispatcherHandler` first calls all implementations of `HandlerAdapter` and only if they succeeds the `HandlerResultHandler` implementations (the `WebTestClientInitializer` is one of them) are called (see [`DispatcherHandler.java#L156-L161`](https://github.com/spring-projects/spring-framework/blob/v5.0.2.RELEASE/spring-webflux/src/main/java/org/springframework/web/reactive/DispatcherHandler.java#L156-L161)).
To solve this issue I simply changed the `WebTestClientInitializer` to implement `HandlerAdapter` instead of `HandlerResultHandler`.1 parent 431f76e commit a75c772
File tree
2 files changed
+15
-23
lines changed- spring-auto-restdocs-core/src
- main/java/capital/scalable/restdocs/webtestclient
- test/java/capital/scalable/restdocs/webtestclient
2 files changed
+15
-23
lines changedLines changed: 7 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | | - | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | | - | |
53 | | - | |
| 52 | + | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
| 60 | + | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
Lines changed: 8 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
61 | | - | |
| 59 | + | |
62 | 60 | | |
63 | 61 | | |
64 | 62 | | |
65 | | - | |
| 63 | + | |
66 | 64 | | |
67 | 65 | | |
68 | 66 | | |
69 | | - | |
70 | 67 | | |
71 | 68 | | |
72 | 69 | | |
73 | | - | |
| 70 | + | |
74 | 71 | | |
75 | 72 | | |
76 | 73 | | |
| |||
79 | 76 | | |
80 | 77 | | |
81 | 78 | | |
82 | | - | |
83 | 79 | | |
84 | | - | |
85 | 80 | | |
86 | 81 | | |
87 | | - | |
| 82 | + | |
88 | 83 | | |
89 | 84 | | |
90 | 85 | | |
91 | | - | |
92 | 86 | | |
93 | 87 | | |
94 | 88 | | |
95 | 89 | | |
96 | | - | |
| 90 | + | |
97 | 91 | | |
98 | 92 | | |
99 | 93 | | |
| |||
104 | 98 | | |
105 | 99 | | |
106 | 100 | | |
107 | | - | |
| 101 | + | |
108 | 102 | | |
109 | 103 | | |
110 | 104 | | |
| |||
139 | 133 | | |
140 | 134 | | |
141 | 135 | | |
142 | | - | |
143 | 136 | | |
144 | | - | |
145 | | - | |
| 137 | + | |
146 | 138 | | |
147 | 139 | | |
148 | 140 | | |
| |||
0 commit comments