From 4c9936cc372f4b09dab9849fdd34697e76b347b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Merlin=20B=C3=B6gershausen?= Date: Fri, 26 Apr 2024 21:12:09 +0200 Subject: [PATCH] apply best practices --- .../testngtojupiter/MigrateDataProvider.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/io/github/mboegers/openrewrite/testngtojupiter/MigrateDataProvider.java b/src/main/java/io/github/mboegers/openrewrite/testngtojupiter/MigrateDataProvider.java index 6674aca..9514cba 100644 --- a/src/main/java/io/github/mboegers/openrewrite/testngtojupiter/MigrateDataProvider.java +++ b/src/main/java/io/github/mboegers/openrewrite/testngtojupiter/MigrateDataProvider.java @@ -44,20 +44,20 @@ public String getDescription() { public TreeVisitor getVisitor() { return new TreeVisitor<>() { @Override - public @Nullable Tree visit(@Nullable Tree tree, ExecutionContext executionContext, Cursor parent) { - tree = super.visit(tree, executionContext, parent); + public @Nullable Tree visit(@Nullable Tree tree, ExecutionContext ctx, Cursor parent) { + tree = super.visit(tree, ctx, parent); // wrap methods - tree = new WrapDataProviderMethod().visit(tree, executionContext, parent); + tree = new WrapDataProviderMethod().visit(tree, ctx, parent); // remove @DataProvider - tree = new RemoveAnnotationVisitor(DATA_PROVIDER_MATCHER).visit(tree, executionContext, parent); + tree = new RemoveAnnotationVisitor(DATA_PROVIDER_MATCHER).visit(tree, ctx, parent); // use @MethodeSource and @ParameterizedTest - tree = new UseParameterizedTest().visit(tree, executionContext, parent); - tree = new UseMethodSource().visit(tree, executionContext, parent); + tree = new UseParameterizedTest().visit(tree, ctx, parent); + tree = new UseMethodSource().visit(tree, ctx, parent); // remove dataProviderName and dataProviderClass arguments tree = new RemoveAnnotationAttribute("org.testng.annotations.Test", "dataProvider") - .getVisitor().visit(tree, executionContext); + .getVisitor().visit(tree, ctx); tree = new RemoveAnnotationAttribute("org.testng.annotations.Test", "dataProviderClass") - .getVisitor().visit(tree, executionContext); + .getVisitor().visit(tree, ctx); return tree; } };