Skip to content

Commit

Permalink
Use noop recipe rather than throwing an error when no recipe is confi…
Browse files Browse the repository at this point in the history
…gured.
  • Loading branch information
sambsnyd committed Sep 11, 2024
1 parent 1e2e9f2 commit 45f5198
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.openrewrite.remote.Remote;
import org.openrewrite.tree.ParseError;

import java.io.ByteArrayInputStream;
import java.nio.file.Path;
import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;
Expand Down Expand Up @@ -152,10 +151,9 @@ default void rewriteRun(Consumer<RecipeSpec> spec, SourceSpec<?>... sourceSpecs)

PrintOutputCapture<Integer> out = new PrintOutputCapture<>(0, markerPrinter);

Recipe recipe = testMethodSpec.recipe == null ? testClassSpec.recipe : testMethodSpec.recipe;
assertThat(recipe)
.as("A recipe must be specified")
.isNotNull();
Recipe recipe = testMethodSpec.recipe == null ?
testClassSpec.recipe == null ? Recipe.noop() : testClassSpec.recipe :
testMethodSpec.recipe;

if (!(recipe instanceof AdHocRecipe) && !(recipe instanceof AdHocScanningRecipe) &&
!(recipe instanceof CompositeRecipe) && !(recipe.equals(Recipe.noop())) &&
Expand Down

0 comments on commit 45f5198

Please sign in to comment.