Skip to content

Commit 17ad316

Browse files
authored
Validate recipes are found in package (#6179)
1 parent f81a544 commit 17ad316

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

rewrite-test/src/main/java/org/openrewrite/test/RewriteTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,13 @@ static Recipe fromRuntimeClasspath(String recipe) {
7878
default void assertRecipesConfigure(String packageName) {
7979
// soft assertions allow the entire stack trace to be displayed for each
8080
// recipe that fails to configure
81-
SoftAssertions softly = new SoftAssertions();
82-
for (Recipe recipe : Environment.builder()
81+
List<Recipe> recipes = Environment.builder()
8382
.scanRuntimeClasspath(packageName)
8483
.build()
85-
.listRecipes()) {
84+
.listRecipes();
85+
assertThat(recipes).as("No recipes found in %s", packageName).isNotEmpty();
86+
SoftAssertions softly = new SoftAssertions();
87+
for (Recipe recipe : recipes) {
8688
// scanRuntimeClasspath picks up all recipes in META-INF/rewrite regardless of whether their
8789
// names start with the package we intend to filter on here
8890
if (recipe.getName().startsWith(packageName)) {

0 commit comments

Comments
 (0)