19
19
import lombok .Setter ;
20
20
import org .springframework .sbm .engine .context .ProjectContext ;
21
21
import org .springframework .sbm .engine .context .ProjectContextHolder ;
22
- import org .springframework .sbm .engine .recipe .Action ;
23
22
import org .springframework .sbm .engine .recipe .Recipe ;
24
23
import org .springframework .sbm .engine .recipe .Recipes ;
25
24
import org .springframework .sbm .project .resource .TestProjectContext ;
29
28
import org .stringtemplate .v4 .ST ;
30
29
31
30
import java .nio .file .Path ;
31
+ import java .util .ArrayList ;
32
32
import java .util .List ;
33
33
import java .util .Map ;
34
34
import java .util .function .Consumer ;
@@ -115,7 +115,7 @@ private void verifyDoesNotRender() {
115
115
if (SectionBuilderData .class .isInstance (builderData )) {
116
116
SectionBuilderData sectionBuilderData = SectionBuilderData .class .cast (builderData );
117
117
withRecipes (recipes -> {
118
- Recipe recipe = recipes .getRecipeByName ("boot-2.7-3.0-upgrade-report2 " ).get ();
118
+ Recipe recipe = recipes .getRecipeByName ("sbu30-report " ).get ();
119
119
SpringBootUpgradeReportAction action = (SpringBootUpgradeReportAction ) recipe .getActions ().get (0 );
120
120
List <SpringBootUpgradeReportSection > sections = (List <SpringBootUpgradeReportSection >) ReflectionTestUtils .getField (recipe .getActions ().get (0 ), "sections" );
121
121
List <SpringBootUpgradeReportSection > matchingSections = sections
@@ -134,7 +134,7 @@ private void verifyDoesNotRender() {
134
134
} else if (ReportBuilderData .class .isInstance (builderData )) {
135
135
ReportBuilderData reportBuilderData = ReportBuilderData .class .cast (builderData );
136
136
withRecipes (recipes -> {
137
- Recipe recipe = recipes .getRecipeByName ("boot-2.7-3.0-upgrade-report2 " ).get ();
137
+ Recipe recipe = recipes .getRecipeByName ("sbu30-report " ).get ();
138
138
SpringBootUpgradeReportAction action = (SpringBootUpgradeReportAction ) recipe .apply (reportBuilderData .getContext ()).get (0 );
139
139
bruteForceProjectContextIntoProjectContextHolder (reportBuilderData .getContext (), action );
140
140
List <SpringBootUpgradeReportSection > sections = (List <SpringBootUpgradeReportSection >) ReflectionTestUtils .getField (recipe .getActions ().get (0 ), "sections" );
@@ -159,15 +159,15 @@ private void verify(Consumer<String> assertion) {
159
159
if (ReportBuilderData .class .isInstance (builderData )) {
160
160
ReportBuilderData reportBuilderData = ReportBuilderData .class .cast (builderData );
161
161
withRecipes (recipes -> {
162
- Recipe recipe = recipes .getRecipeByName ("boot-2.7-3.0-upgrade-report2 " ).get ();
162
+ Recipe recipe = recipes .getRecipeByName ("sbu30-report " ).get ();
163
163
SpringBootUpgradeReportAction action = (SpringBootUpgradeReportAction ) recipe .getActions ().get (0 );
164
164
bruteForceProjectContextIntoProjectContextHolder (builderData .getContext (), action );
165
165
// ReflectionTestUtils.setField(action, "upgradeReportProcessor", (SpringBootUpgradeReportFileSystemRenderer) s -> assertion.accept(s));
166
166
action .apply (reportBuilderData .getContext ());
167
167
});
168
168
} else if (SectionBuilderData .class .isInstance (builderData )) {
169
169
withRecipes (recipes -> {
170
- Recipe recipe = recipes .getRecipeByName ("boot-2.7-3.0-upgrade-report2 " ).get ();
170
+ Recipe recipe = recipes .getRecipeByName ("sbu30-report " ).get ();
171
171
SpringBootUpgradeReportAction action = (SpringBootUpgradeReportAction ) recipe .getActions ().get (0 );
172
172
bruteForceProjectContextIntoProjectContextHolder (builderData .getContext (), action );
173
173
List <SpringBootUpgradeReportSection > sections = (List <SpringBootUpgradeReportSection >) ReflectionTestUtils .getField (recipe .getActions ().get (0 ), "sections" );
@@ -239,7 +239,7 @@ private String replaceRecipeButtonCodeFromExpectedOutput(SpringBootUpgradeReport
239
239
240
240
private void withRecipes (Consumer <Recipes > recipesConsumer ) {
241
241
RecipeTestSupport .testRecipe (
242
- Path .of ("recipes/boot-new -report.yaml" ), recipesConsumer ,
242
+ Path .of ("recipes/27_30/report/sbu30 -report.yaml" ), recipesConsumer ,
243
243
SpringBootUpgradeReportActionDeserializer .class ,
244
244
SpringBootUpgradeReportFreemarkerSupport .class ,
245
245
SpringBootUpgradeReportFileSystemRenderer .class ,
0 commit comments