@@ -28,7 +28,7 @@ public class FullSampleMigrationTest implements RewriteTest {
2828
2929 static final String GOLDEN_IMAGE = "v2" ;
3030 static final String ORIGINAL_IMAGE = "v1" ;
31-
31+ static final String RECIPE_NAME = "com.azure.openrewrite.migrateToVNext" ;
3232 static final String [] DISABLED_DIRS = {
3333 "src/test/resources/migrationExamples/azure-storage-blob/"
3434 };
@@ -67,13 +67,13 @@ static Stream<Path> gatherAllRegularFiles(Path sampleDir) throws IOException {
6767
6868 @ Override
6969 public void defaults (RecipeSpec spec ) {
70- spec .recipeFromResources ("com.azure.openrewrite.migrateToVNext" )
70+ System .out .printf ("Active recipe: %s\n " , RECIPE_NAME );
71+ spec .recipeFromResources (RECIPE_NAME )
7172 .typeValidationOptions (TypeValidation .none ());
7273 }
7374
7475
7576
76-
7777 @ ParameterizedTest
7878 @ MethodSource ("sampleDirectories" )
7979 public void testGoldenImage (Path sampleDir ) throws Exception {
@@ -98,14 +98,20 @@ public void testGoldenImage(Path sampleDir) throws Exception {
9898 public void assertFullMigration (Map <String ,String > fileMap ) throws IOException {
9999 List <SourceSpecs > sourceSpecs = new ArrayList <SourceSpecs >();
100100 for (Map .Entry <String ,String > entry : fileMap .entrySet ()) {
101+
101102 String before = Files .readAllLines (Paths .get (entry .getKey ()))
102103 .stream ()
103104 .reduce ("" , (a , b ) -> a + b + "\n " );
104105
105106 String after = Files .readAllLines (Paths .get (entry .getValue ()))
106107 .stream ()
107108 .reduce ("" , (a , b ) -> a + b + "\n " );
108- sourceSpecs .add (java (before , after ));
109+ if (!before .equals (after )) {
110+ sourceSpecs .add (java (before , after ));
111+ }
112+ }
113+ if (sourceSpecs .isEmpty ()) {
114+ Assumptions .abort ("Migration samples are identical. No migration detected." );
109115 }
110116 rewriteRun (
111117 sourceSpecs .toArray (new SourceSpecs [sourceSpecs .size ()])
0 commit comments