Skip to content

Commit c0a147b

Browse files
committed
fix: Fix failing test SpringMVCAndWebFluxUrlMatchingChangesReportSectionTest
1 parent 5cc4aa5 commit c0a147b

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

components/sbm-recipes-boot-upgrade/src/main/resources/recipes/27_30/report/sbu30-report.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@
315315
@GetMapping("/some/greeting")
316316
public String greeting {
317317
return "Hello";
318-
}
318+
}
319319
320320
}
321321
----
@@ -335,7 +335,7 @@
335335
public void configurePathMatch(PathMatchConfigurer configurer) {
336336
configurer.setUseTrailingSlashMatch(true);
337337
}
338-
338+
339339
}
340340
----
341341
sources:
@@ -362,7 +362,7 @@
362362
existing request mapping.
363363
364364
[source, java]
365-
....
365+
----
366366
@RequestMapping(value = {"/current/path", "current/path/"})
367367
368368
@RequestMapping(path = {"/current/path", "current/path/"})
@@ -371,7 +371,7 @@
371371
372372
@GetMapping(path = {"/current/path", "current/path/"})
373373
...
374-
....
374+
----
375375
resources:
376376
- https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/bind/annotation/GetMapping.html[@GetMapping API]
377377
- https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/bind/annotation/RequestMapping.html[@RequestMapping API]
@@ -381,7 +381,7 @@
381381
If all rest controllers must serve requests with trailing `/`, a `PathMatchConfigurer` should be configured like so:
382382
383383
[source, java]
384-
....
384+
----
385385
@Configuration
386386
public class WebConfiguration implements WebMvcConfigurer {
387387
@@ -391,7 +391,7 @@
391391
}
392392
393393
}
394-
....
394+
----
395395
396396
recipe: sbu30-248-add-PathMatchConfigurer
397397
gitHubIssue: 522

components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/helper/SpringMVCAndWebFluxUrlMatchingChangesReportSectionTest.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ public class AnotherClass {};
7272
As of Spring Framework 6.0, the trailing slash matching configuration option has been deprecated and its default value set to `false`.
7373
This means that previously, the following controller would match both "GET /some/greeting" and "GET /some/greeting/":
7474
75-
```
75+
[source, java]
76+
----
7677
@RestController
7778
public class MyController {
7879
@@ -82,16 +83,16 @@ public class MyController {
8283
}
8384
8485
}
85-
```
86+
----
8687
87-
As of https://github.com/spring-projects/spring-framework/issues/28552[this Spring Framework change], "GET /some/greeting/" doesn't
88-
match anymore by default.
88+
As of https://github.com/spring-projects/spring-framework/issues/28552[this Spring Framework change], "GET /some/greeting/" doesn't match anymore by default.
8989
9090
Developers should instead configure explicit redirects/rewrites through a proxy, a Servlet/web filter, or even declare the additional route explicitly on the controller handler (like `@GetMapping("/some/greeting", "/some/greeting/")` for more targeted cases.
9191
9292
Until your application fully adapts to this change, you can change the default with the following global configuration:
9393
94-
```
94+
[source, java]
95+
----
9596
@Configuration
9697
public class WebConfiguration implements WebMvcConfigurer {
9798
@@ -101,7 +102,7 @@ public void configurePathMatch(PathMatchConfigurer configurer) {
101102
}
102103
103104
}
104-
```
105+
----
105106
106107
==== Why is the application affected
107108
The scan found classes annotated with `@RestController` which could be affected by this change.
@@ -122,7 +123,7 @@ public void configurePathMatch(PathMatchConfigurer configurer) {
122123
existing request mapping.
123124
124125
[source, java]
125-
....
126+
----
126127
@RequestMapping(value = {"/current/path", "current/path/"})
127128
128129
@RequestMapping(path = {"/current/path", "current/path/"})
@@ -131,7 +132,7 @@ public void configurePathMatch(PathMatchConfigurer configurer) {
131132
132133
@GetMapping(path = {"/current/path", "current/path/"})
133134
...
134-
....
135+
----
135136
136137
* https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/bind/annotation/GetMapping.html[@GetMapping API]
137138
* https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/bind/annotation/RequestMapping.html[@RequestMapping API]
@@ -140,7 +141,7 @@ public void configurePathMatch(PathMatchConfigurer configurer) {
140141
If all rest controllers must serve requests with trailing `/`, a `PathMatchConfigurer` should be configured like so:
141142
142143
[source, java]
143-
....
144+
----
144145
@Configuration
145146
public class WebConfiguration implements WebMvcConfigurer {
146147
@@ -150,7 +151,7 @@ public void configurePathMatch(PathMatchConfigurer configurer) {
150151
}
151152
152153
}
153-
....
154+
----
154155
155156
156157
""";

0 commit comments

Comments
 (0)