Skip to content

Commit a4c1250

Browse files
authored
Add report for Spring MVC and WebFlux URL matching changes (#529)
- Fix SpringBootUpgradeReportActionTest - Adjust Changes to Data Properties report section to new format - Remove wrong reference to recipe - Adjust Banner support test to new format - Add test for Logging Date Format report section - Enhance LoggingDateFormatHelperTest - Add test for LoggingDateFormatHelper - Remove obsolete parameter ProjectContext from getData() - Adapt new YAML structure to Constructor Binding section - Cleaned up SpringBootUpgradeReportSection
1 parent e38c0da commit a4c1250

20 files changed

+995
-113
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
name: 3.0 Upgrade Recipe
3+
about: Template for Spring Boot 3 Upgrade Receipe
4+
title: '3.0 Upgrade Recipe: '
5+
labels: '3.0.0, good first issue, type: enhancement, upgrade:boot-recipe'
6+
assignees: ''
7+
8+
---
9+
10+
## What needs to be done
11+
12+
An automated migration recipe for [`{{Release Note title}}`]({{http://link-to-section.foo}}) should be created.
13+
14+
15+
### Condition
16+
{{Describe when the section should be rendered}}
17+
18+
19+
### Report Section Issue
20+
21+
{{GH id for report issue}}
22+
23+
24+
### DoD
25+
- [ ] Action implemented
26+
- [ ] Description provided
27+
- [ ] Tests (single and multi-module)
28+
- [ ] Condition implemented / reused
29+
- [ ] Description provided
30+
- [ ] Tests (single and multi-module)
31+
- [ ] Recipe yaml added
32+
- [ ] Test
33+
- [ ] Integration test (single and multi-module)
34+
35+
36+
37+
## Recipe YAML Example
38+
39+
This provides an example with information about how a automated migration recipe should be defined in `YAML`.
40+
41+
<details>
42+
<summary>Report Section YAML (example)</summary>
43+
44+
````yaml
45+
46+
````
47+
48+
</details>
49+
50+
## Additional Resources & Information
51+
- Example
52+
- Testing Actions
53+
- Testing Conditions
54+
- Testing Recipes
55+
- Integration Tests
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright 2021 - 2022 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.springframework.sbm.boot.upgrade_27_30.report;
17+
18+
import lombok.Getter;
19+
import lombok.Setter;
20+
import org.jetbrains.annotations.NotNull;
21+
import org.jetbrains.annotations.Nullable;
22+
23+
import javax.validation.constraints.NotEmpty;
24+
import java.util.ArrayList;
25+
import java.util.List;
26+
27+
/**
28+
* @author Fabian Krüger
29+
*/
30+
@Getter
31+
@Setter
32+
public class Remediation extends ResourceList{
33+
@NotEmpty
34+
private String description;
35+
@NotNull
36+
private List<RemediationPossibility> possibilities = new ArrayList<>();
37+
/**
38+
* The name of the recipe for automated migration or {@code null} of none exist.
39+
*/
40+
@Nullable
41+
private String recipe;
42+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright 2021 - 2022 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.springframework.sbm.boot.upgrade_27_30.report;
17+
18+
import lombok.Getter;
19+
import lombok.Setter;
20+
21+
import javax.validation.constraints.Null;
22+
import java.util.ArrayList;
23+
import java.util.List;
24+
25+
/**
26+
* @author Fabian Krüger
27+
*/
28+
@Getter
29+
@Setter
30+
public class RemediationPossibility extends ResourceList {
31+
String title;
32+
String description;
33+
String recipe;
34+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright 2021 - 2022 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.springframework.sbm.boot.upgrade_27_30.report;
17+
18+
import lombok.Getter;
19+
import lombok.Setter;
20+
import org.jetbrains.annotations.Nullable;
21+
22+
import java.util.ArrayList;
23+
import java.util.List;
24+
25+
/**
26+
* @author Fabian Krüger
27+
*/
28+
@Getter
29+
@Setter
30+
public abstract class ResourceList {
31+
List<String> resources = new ArrayList<>();
32+
}

components/sbm-recipes-boot-upgrade/src/main/java/org/springframework/sbm/boot/upgrade_27_30/report/SpringBootUpgradeReportAction.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ public interface DataProvider {
8686
@Autowired
8787
private SpringBootUpgradeReportFreemarkerSupport freemarkerSupport;
8888

89+
@Valid
90+
List<SpringBootUpgradeReportSection> sections;
91+
8992
@JsonIgnore
9093
@Autowired
9194
private DataProvider dataProvider = new DataProvider() {
@@ -95,8 +98,6 @@ public Map<String, Object> getData(ProjectContext context, @Valid List<SpringBoo
9598
}
9699
};
97100

98-
@Valid
99-
List<SpringBootUpgradeReportSection> sections;
100101

101102
@Override
102103
public String getDescription() {

0 commit comments

Comments
 (0)