From 55ef3ca3f99363690372e9357f7ff098878473e4 Mon Sep 17 00:00:00 2001 From: sanagaraj-pivotal Date: Mon, 24 Oct 2022 10:46:52 +0100 Subject: [PATCH 1/8] Fixing Boot upgrade pattern --- .../src/main/resources/recipes/boot-new-report.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/sbm-recipes-boot-upgrade/src/main/resources/recipes/boot-new-report.yaml b/components/sbm-recipes-boot-upgrade/src/main/resources/recipes/boot-new-report.yaml index fc6309836..73e15f54f 100644 --- a/components/sbm-recipes-boot-upgrade/src/main/resources/recipes/boot-new-report.yaml +++ b/components/sbm-recipes-boot-upgrade/src/main/resources/recipes/boot-new-report.yaml @@ -2,7 +2,7 @@ description: Create a report for Spring Boot Upgrade from 2.7.x to 3.0.x condition: type: org.springframework.sbm.boot.common.conditions.IsSpringBootProject - versionPattern: "2\\.4\\..*|2\\.5\\..*" + versionPattern: "2\\.7\\..*" actions: @@ -116,4 +116,4 @@ footer: |- We want to say thank you to all Contributors: - Generated by Spring Boot Migrator (experimental) \ No newline at end of file + Generated by Spring Boot Migrator (experimental) From 5ddcf6903f297ddd7415d1163ae9d3473c31e39c Mon Sep 17 00:00:00 2001 From: sanagaraj-pivotal Date: Mon, 24 Oct 2022 14:25:15 +0100 Subject: [PATCH 2/8] BannerSupport --- .../report/helper/BannerSupportHelper.java | 56 +++++++++++++++++++ .../helper/ChangesToDataPropertiesHelper.java | 2 - .../resources/recipes/boot-new-report.yaml | 17 ++++++ .../ChangesToDataPropertiesReportTest.java | 3 +- .../SpringBootUpgradeReportTestSupport.java | 13 ++++- .../helper/BannerSupportHelperTest.java | 56 +++++++++++++++++++ 6 files changed, 142 insertions(+), 5 deletions(-) create mode 100644 components/sbm-recipes-boot-upgrade/src/main/java/org/springframework/sbm/boot/upgrade_27_30/report/helper/BannerSupportHelper.java create mode 100644 components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/helper/BannerSupportHelperTest.java diff --git a/components/sbm-recipes-boot-upgrade/src/main/java/org/springframework/sbm/boot/upgrade_27_30/report/helper/BannerSupportHelper.java b/components/sbm-recipes-boot-upgrade/src/main/java/org/springframework/sbm/boot/upgrade_27_30/report/helper/BannerSupportHelper.java new file mode 100644 index 000000000..82db3824a --- /dev/null +++ b/components/sbm-recipes-boot-upgrade/src/main/java/org/springframework/sbm/boot/upgrade_27_30/report/helper/BannerSupportHelper.java @@ -0,0 +1,56 @@ +/* + * Copyright 2021 - 2022 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.sbm.boot.upgrade_27_30.report.helper; + +import org.springframework.sbm.boot.upgrade_27_30.report.SpringBootUpgradeReportSection; +import org.springframework.sbm.engine.context.ProjectContext; +import org.springframework.sbm.project.resource.RewriteSourceFileHolder; + +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public class BannerSupportHelper implements SpringBootUpgradeReportSection.Helper> { + + private List foundBanners; + + @Override + public String getDescription() { + return ""; + } + + @Override + public boolean evaluate(ProjectContext context) { + foundBanners = context + .getProjectResources() + .stream() + .map(RewriteSourceFileHolder::getAbsolutePath) + .filter(absolutePath -> absolutePath.toString() + .matches(".*banner.(jpg|gif|png)$") + ) + .collect(Collectors.toList()); + return !foundBanners.isEmpty(); + } + + @Override + public Map> getData(ProjectContext context) { + + return Map.of("files", foundBanners.stream().map(Path::toString).collect(Collectors.toList())); + } +} diff --git a/components/sbm-recipes-boot-upgrade/src/main/java/org/springframework/sbm/boot/upgrade_27_30/report/helper/ChangesToDataPropertiesHelper.java b/components/sbm-recipes-boot-upgrade/src/main/java/org/springframework/sbm/boot/upgrade_27_30/report/helper/ChangesToDataPropertiesHelper.java index 252cff578..2bc60459c 100644 --- a/components/sbm-recipes-boot-upgrade/src/main/java/org/springframework/sbm/boot/upgrade_27_30/report/helper/ChangesToDataPropertiesHelper.java +++ b/components/sbm-recipes-boot-upgrade/src/main/java/org/springframework/sbm/boot/upgrade_27_30/report/helper/ChangesToDataPropertiesHelper.java @@ -19,11 +19,9 @@ import lombok.RequiredArgsConstructor; import org.springframework.sbm.boot.properties.api.SpringBootApplicationProperties; import org.springframework.sbm.boot.properties.search.SpringBootApplicationPropertiesResourceListFilter; -import org.springframework.sbm.boot.upgrade_27_30.report.SpringBootUpgradeReportAction; import org.springframework.sbm.boot.upgrade_27_30.report.SpringBootUpgradeReportSection; import org.springframework.sbm.build.migration.conditions.NoDependencyExistMatchingRegex; import org.springframework.sbm.engine.context.ProjectContext; -import org.springframework.sbm.engine.recipe.Condition; import java.nio.file.Path; import java.util.ArrayList; diff --git a/components/sbm-recipes-boot-upgrade/src/main/resources/recipes/boot-new-report.yaml b/components/sbm-recipes-boot-upgrade/src/main/resources/recipes/boot-new-report.yaml index 73e15f54f..19f945a84 100644 --- a/components/sbm-recipes-boot-upgrade/src/main/resources/recipes/boot-new-report.yaml +++ b/components/sbm-recipes-boot-upgrade/src/main/resources/recipes/boot-new-report.yaml @@ -113,6 +113,23 @@ contributors: - "Fabian Krüger[@fabapp2]" + - title: Banner support + helper: org.springframework.sbm.boot.upgrade_27_30.report.helper.BannerSupportHelper + change: |- + Support for image-based application banners has been removed. banner.gif, banner.jpg, and banner.png + files are now ignored and should be replaced with a text-based banner.txt file. + affected: |- + The scan found banner image files here: + + <#list files as file> + * ${file} + + remediation: |- + remove image banners and replace it with text-banner with banner.txt file + gitHubIssue: 150 + recipe: boot-2.7-3.0-upgrade-report + contributors: + - "Sandeep Nagaraj[@sanagaraj-pivotal]" footer: |- We want to say thank you to all Contributors: diff --git a/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/ChangesToDataPropertiesReportTest.java b/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/ChangesToDataPropertiesReportTest.java index b9bf7bf7c..bec3117d2 100644 --- a/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/ChangesToDataPropertiesReportTest.java +++ b/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/ChangesToDataPropertiesReportTest.java @@ -61,8 +61,7 @@ void changesToDataPropertiesSection() { ==== Remediation Either add `spring-data` dependency, rename the property or remove it in case it's not required anymore. - """, Map.of("PATH", Path - .of(".").toAbsolutePath().resolve(TestProjectContext.getDefaultProjectRoot()).toString())); + """); } } diff --git a/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/SpringBootUpgradeReportTestSupport.java b/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/SpringBootUpgradeReportTestSupport.java index d4091c83f..6e459bf07 100644 --- a/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/SpringBootUpgradeReportTestSupport.java +++ b/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/SpringBootUpgradeReportTestSupport.java @@ -20,6 +20,7 @@ import org.springframework.sbm.engine.context.ProjectContext; import org.springframework.sbm.engine.recipe.Recipe; import org.springframework.sbm.engine.recipe.Recipes; +import org.springframework.sbm.project.resource.TestProjectContext; import org.springframework.sbm.test.RecipeTestSupport; import org.springframework.sbm.testhelper.common.utils.TestDiff; import org.springframework.test.util.ReflectionTestUtils; @@ -73,7 +74,7 @@ public Assertion(BuilderData builderData) { public void shouldRenderAs(String expectedOutput) { - shouldRenderAs(expectedOutput, Map.of()); + shouldRenderAs(expectedOutput, defaultMap()); } public void shouldRenderAs(String expectedOutput, Map templateVariables) { @@ -92,6 +93,16 @@ public void shouldStartWith(String expectedOutput, Map templateV verify(assertion); } + + private Map defaultMap() { + String path = Path + .of(".") + .toAbsolutePath() + .resolve(TestProjectContext.getDefaultProjectRoot()).toString(); + + return Map.of("PATH", path); + } + private void verify(Consumer assertion) { if(ReportBuilderData.class.isInstance(builderData)) { ReportBuilderData reportBuilderData = ReportBuilderData.class.cast(builderData); diff --git a/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/helper/BannerSupportHelperTest.java b/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/helper/BannerSupportHelperTest.java new file mode 100644 index 000000000..9b9c43e5a --- /dev/null +++ b/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/helper/BannerSupportHelperTest.java @@ -0,0 +1,56 @@ +/* + * Copyright 2021 - 2022 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.sbm.boot.upgrade_27_30.report.helper; + +import org.junit.jupiter.api.Test; +import org.springframework.sbm.boot.upgrade_27_30.report.SpringBootUpgradeReportTestSupport; +import org.springframework.sbm.engine.context.ProjectContext; +import org.springframework.sbm.project.resource.TestProjectContext; + +public class BannerSupportHelperTest { + + @Test + public void rendersBannerSupportInformation() { + ProjectContext context = TestProjectContext.buildProjectContext() + .addProjectResource("src/main/resources/banner.gif", "gif-banner") + .addProjectResource("src/main/resources/banner.jpg", "jpg-banner") + .build(); + + SpringBootUpgradeReportTestSupport + .generatedSection("Banner support") + .fromProjectContext(context) + .shouldRenderAs( + """ + === Banner support + Issue: https://github.com/spring-projects-experimental/spring-boot-migrator/issues/150[#150], Contributors: https://github.com/sanagaraj-pivotal[@sanagaraj-pivotal^, role="ext-link"] + + ==== What Changed + Support for image-based application banners has been removed. banner.gif, banner.jpg, and banner.png\s + files are now ignored and should be replaced with a text-based banner.txt file. + + ==== Why is the application affected + The scan found banner image files here: + + * /src/main/resources/banner.gif + * /src/main/resources/banner.jpg + + ==== Remediation + remove image banners and replace it with text-banner with banner.txt file + + """); + } +} From 5206f285b422a9b2dc71cf2d580b630645d35d9e Mon Sep 17 00:00:00 2001 From: sanagaraj-pivotal Date: Mon, 24 Oct 2022 14:26:32 +0100 Subject: [PATCH 3/8] more --- .../upgrade_27_30/report/helper/BannerSupportHelperTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/helper/BannerSupportHelperTest.java b/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/helper/BannerSupportHelperTest.java index 9b9c43e5a..8d1c23a96 100644 --- a/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/helper/BannerSupportHelperTest.java +++ b/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/helper/BannerSupportHelperTest.java @@ -28,6 +28,7 @@ public void rendersBannerSupportInformation() { ProjectContext context = TestProjectContext.buildProjectContext() .addProjectResource("src/main/resources/banner.gif", "gif-banner") .addProjectResource("src/main/resources/banner.jpg", "jpg-banner") + .addProjectResource("src/main/com/test/banner.java","class banner {}") .build(); SpringBootUpgradeReportTestSupport From 47d00e32b49fbf8d3aab48ed695d8ae1b0fb1de8 Mon Sep 17 00:00:00 2001 From: sanagaraj-pivotal Date: Mon, 24 Oct 2022 14:57:35 +0100 Subject: [PATCH 4/8] more --- .../SpringBootUpgradeReportActionTest.java | 51 ++++++++++--------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/SpringBootUpgradeReportActionTest.java b/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/SpringBootUpgradeReportActionTest.java index 78fefb055..581684a29 100644 --- a/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/SpringBootUpgradeReportActionTest.java +++ b/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/SpringBootUpgradeReportActionTest.java @@ -46,6 +46,7 @@ void renderReport() throws IOException { String expectedOutput = """ [[index]] = Spring Boot 3 Upgrade Report + Sandeep Nagaraj,\s Fabian Krüger :source-highlighter: highlight.js :highlightjs-languages: java @@ -67,68 +68,68 @@ void renderReport() throws IOException { :spring-boot-artifactory-repo: snapshot :github-tag: main :spring-boot-version: current - + == Introduction [cols="1h,3"] |=== - | Scanned dir | `` + | Scanned dir | `/Users/sanagaraj/workspace/opensource/spring-boot-migrator/components/sbm-recipes-boot-upgrade/target/dummy-test-path` | Revision | Scanned project not under Git | Coordinate | `com.example:dummy-root:0.1.0-SNAPSHOT` | Boot version | `2.7.3` - | Changes | 2 + | Changes | 3 |=== - + The application was scanned and matched against the changes listed in the https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.5-Release-Notes[Spring Boot 2.5 Release Notes] as well as from https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-5.x[Spring Framework 5.x Release Notes]. - + The Relevant Changes section lists all potentially required changes to upgrade the scanned application to Spring Boot 2.5.6. - + NOTE: JDK 17 is required for Spring Boot 3 - + == Relevant Changes - + This section lists the changes SBM found to be applicable to upgrade the scanned application to Spring Boot 3.0.0.\s - + === Changes to Data Properties Issue: https://github.com/spring-projects-experimental/spring-boot-migrator/issues/123[#123], Contributors: https://github.com/fabapp2[@fabapp2^, role="ext-link"] - + ==== What Changed The data prefix has been reserved for Spring Data and any properties under the `data` prefix imply that Spring Data is required on the classpath. - + ==== Why is the application affected The scan found properties with `spring.data` prefix but no dependency matching `org.springframework.data:.*`. - - * file:///src/main/resources/application.properties[`src/main/resources/application.properties`] + + * file:///Users/sanagaraj/workspace/opensource/spring-boot-migrator/components/sbm-recipes-boot-upgrade/target/dummy-test-path/src/main/resources/application.properties[`src/main/resources/application.properties`] ** `spring.data.foo` - * file:///src/main/resources/application-another.properties[`src/main/resources/application-another.properties`] + * file:///Users/sanagaraj/workspace/opensource/spring-boot-migrator/components/sbm-recipes-boot-upgrade/target/dummy-test-path/src/main/resources/application-another.properties[`src/main/resources/application-another.properties`] ** `spring.data.here` - + ==== Remediation Either add `spring-data` dependency, rename the property or remove it in case it's not required anymore. - - + + === Logging Date Format Issue: https://github.com/spring-projects-experimental/spring-boot-migrator/issues/489[#489], Contributors: https://github.com/fabapp2[@fabapp2^, role="ext-link"] - + ==== What Changed The default format for the date and time component of log messages for Logback and Log4j2 has changed to\s align with the ISO-8601 standard. The new default format `yyyy-MM-dd’T’HH:mm:ss.SSSXXX` uses a `T` to\s separate the date and time instead of a space character and adds the timezone offset to the end.\s The `LOG_DATEFORMAT_PATTERN` environment variable or `logging.pattern.dateformat` property can be used to\s restore the previous default value of `yyyy-MM-dd HH:mm:ss.SSS`. - + ==== Why is the application affected The scan found no property `logging.pattern.dateformat`. - + ==== Remediation Set logging.pattern.dateformat=yyyy-MM-dd HH:mm:ss.SSS to fall back to the previous log format. - - - + + + We want to say thank you to all Contributors: - + Generated by Spring Boot Migrator (experimental) """; SpringBootUpgradeReportTestSupport.generatedReport() @@ -140,4 +141,4 @@ Generated by Spring Boot Migrator (experimental) Files.writeString(Path.of(".").toAbsolutePath().resolve("report.html"), context.getProjectResources().get(3).print(), StandardOpenOption.TRUNCATE_EXISTING); } -} \ No newline at end of file +} From a09d1bdb3b335dd6e08c2da33fc1aff6a84920ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Kr=C3=BCger?= Date: Wed, 26 Oct 2022 23:12:39 +0200 Subject: [PATCH 5/8] test: Remove hardcoded paths --- .../report/SpringBootUpgradeReportActionTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/SpringBootUpgradeReportActionTest.java b/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/SpringBootUpgradeReportActionTest.java index 581684a29..19b97eecc 100644 --- a/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/SpringBootUpgradeReportActionTest.java +++ b/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/SpringBootUpgradeReportActionTest.java @@ -72,7 +72,7 @@ void renderReport() throws IOException { == Introduction [cols="1h,3"] |=== - | Scanned dir | `/Users/sanagaraj/workspace/opensource/spring-boot-migrator/components/sbm-recipes-boot-upgrade/target/dummy-test-path` + | Scanned dir | `` | Revision | Scanned project not under Git | Coordinate | `com.example:dummy-root:0.1.0-SNAPSHOT` | Boot version | `2.7.3` @@ -101,9 +101,9 @@ void renderReport() throws IOException { ==== Why is the application affected The scan found properties with `spring.data` prefix but no dependency matching `org.springframework.data:.*`. - * file:///Users/sanagaraj/workspace/opensource/spring-boot-migrator/components/sbm-recipes-boot-upgrade/target/dummy-test-path/src/main/resources/application.properties[`src/main/resources/application.properties`] + * file:///src/main/resources/application.properties[`src/main/resources/application.properties`] ** `spring.data.foo` - * file:///Users/sanagaraj/workspace/opensource/spring-boot-migrator/components/sbm-recipes-boot-upgrade/target/dummy-test-path/src/main/resources/application-another.properties[`src/main/resources/application-another.properties`] + * file:///src/main/resources/application-another.properties[`src/main/resources/application-another.properties`] ** `spring.data.here` ==== Remediation From 1cbfea72d1c7bc68e3bbbb79c286b6c30433e1d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Kr=C3=BCger?= Date: Thu, 27 Oct 2022 11:28:08 +0200 Subject: [PATCH 6/8] test: Adds missing value for path replacement --- .../report/ChangesToDataPropertiesReportTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/ChangesToDataPropertiesReportTest.java b/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/ChangesToDataPropertiesReportTest.java index ab96faa2b..2afc33992 100644 --- a/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/ChangesToDataPropertiesReportTest.java +++ b/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/ChangesToDataPropertiesReportTest.java @@ -62,7 +62,8 @@ void changesToDataPropertiesSection_renders() { ==== Remediation Either add `spring-data` dependency, rename the property or remove it in case it's not required anymore. - """); + """, + Map.of("PATH", Path.of(".").toAbsolutePath().resolve(TestProjectContext.getDefaultProjectRoot()).toString())); } @Test From be043d2933f877e802afe49f74c3cb13f2e1ce2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Kr=C3=BCger?= Date: Thu, 27 Oct 2022 14:33:36 +0200 Subject: [PATCH 7/8] test: Fixes authors in header --- .../src/main/resources/recipes/boot-new-report.yaml | 2 +- .../report/SpringBootUpgradeReportActionTest.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/sbm-recipes-boot-upgrade/src/main/resources/recipes/boot-new-report.yaml b/components/sbm-recipes-boot-upgrade/src/main/resources/recipes/boot-new-report.yaml index fbe753ccd..9d6e55f7c 100644 --- a/components/sbm-recipes-boot-upgrade/src/main/resources/recipes/boot-new-report.yaml +++ b/components/sbm-recipes-boot-upgrade/src/main/resources/recipes/boot-new-report.yaml @@ -18,7 +18,7 @@ = Spring Boot 3 Upgrade Report <#if contributors?has_content> <#list contributors as contributor> - ${contributor.name}<#sep>, + ${contributor.name}<#sep>, :source-highlighter: highlight.js diff --git a/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/SpringBootUpgradeReportActionTest.java b/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/SpringBootUpgradeReportActionTest.java index 51f38895f..8077942af 100644 --- a/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/SpringBootUpgradeReportActionTest.java +++ b/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/SpringBootUpgradeReportActionTest.java @@ -47,6 +47,7 @@ void renderReport() throws IOException { """ [[index]] = Spring Boot 3 Upgrade Report + Sandeep Nagaraj, Fabian Krüger :source-highlighter: highlight.js :highlightjs-languages: java @@ -76,7 +77,7 @@ void renderReport() throws IOException { | Revision | Scanned project not under Git | Coordinate | `com.example:dummy-root:0.1.0-SNAPSHOT` | Boot version | `2.7.3` - | Changes | 2 + | Changes | 3 |=== The application was scanned and matched against the changes listed in the From 6e82ab9d4e6054c57bcf95ab9683cd707ac4fb68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Kr=C3=BCger?= Date: Thu, 27 Oct 2022 17:15:03 +0200 Subject: [PATCH 8/8] test: Adds missing value for path replacement --- .../report/helper/BannerSupportHelperTest.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/helper/BannerSupportHelperTest.java b/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/helper/BannerSupportHelperTest.java index 8d1c23a96..cdf14ee4f 100644 --- a/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/helper/BannerSupportHelperTest.java +++ b/components/sbm-recipes-boot-upgrade/src/test/java/org/springframework/sbm/boot/upgrade_27_30/report/helper/BannerSupportHelperTest.java @@ -21,6 +21,9 @@ import org.springframework.sbm.engine.context.ProjectContext; import org.springframework.sbm.project.resource.TestProjectContext; +import java.nio.file.Path; +import java.util.Map; + public class BannerSupportHelperTest { @Test @@ -52,6 +55,7 @@ public void rendersBannerSupportInformation() { ==== Remediation remove image banners and replace it with text-banner with banner.txt file - """); + """, + Map.of("PATH", Path.of(".").toAbsolutePath().resolve(TestProjectContext.getDefaultProjectRoot()).toString())); } }