@@ -195,23 +195,35 @@ private void verify(Consumer<String> assertion) {
195
195
* code of buttons to apply a recipe.
196
196
*/
197
197
private String replaceRe4cipeButtonCodeFromExpectedOutput (SpringBootUpgradeReportSection sectionUnderTest , String renderedSection ) {
198
- String recipe = sectionUnderTest .getRecipe ();
199
- String target = """
200
-
201
- ++++
202
- <form name="recipe-1" action="http://localhost:8080/spring-boot-upgrade" method="post">
203
- <input type="hidden" name="recipeName" value="<RECIPE>" />
204
- <button name="<RECIPE>" type="submit" style="background-color:#71ea5b;border:width: 120px;
205
- text-align: center;
206
- font-size: 15px;
207
- padding: 20px;
208
- border-radius: 15px;">Run Recipe</button>
209
- </form>
210
- ++++
211
-
212
- """ ;
213
- String buttonCode = target .replace ("<RECIPE>" , recipe );
214
- return renderedSection .replace (buttonCode , "" );
198
+ StringBuilder sb = new StringBuilder ();
199
+ List <String > buttonCodes = sectionUnderTest
200
+ .getRemediation ()
201
+ .getPossibilities ()
202
+ .stream ()
203
+ .filter (p -> p .getRecipe () != null )
204
+ .map (RemediationPossibility ::getRecipe )
205
+ .map (recipe -> {
206
+ String target = """
207
+
208
+ ++++
209
+ <form name="recipe-1" action="http://localhost:8080/spring-boot-upgrade" method="post">
210
+ <input type="hidden" name="recipeName" value="<RECIPE>" />
211
+ <button name="<RECIPE>" type="submit" style="background-color:#71ea5b;border:width: 120px;
212
+ text-align: center;
213
+ font-size: 15px;
214
+ padding: 20px;
215
+ border-radius: 15px;">Run Recipe</button>
216
+ </form>
217
+ ++++
218
+
219
+ """ ;
220
+ return target .replace ("<RECIPE>" , recipe );
221
+ })
222
+ .collect (Collectors .toList ());
223
+ for (String buttonCode : buttonCodes ) {
224
+ renderedSection = renderedSection .replace (buttonCode , "" );
225
+ }
226
+ return renderedSection ;
215
227
}
216
228
217
229
private void withRecipes (Consumer <Recipes > recipesConsumer ) {
0 commit comments