Skip to content

Commit

Permalink
remove unused method
Browse files Browse the repository at this point in the history
  • Loading branch information
MBoegers committed Apr 18, 2024
1 parent 0aa2c84 commit 97f567b
Showing 1 changed file with 0 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,10 @@
import io.github.mboegers.openrewrite.testngtojupiter.helper.FindAnnotatedMethods;
import io.github.mboegers.openrewrite.testngtojupiter.helper.FindAnnotation;
import io.github.mboegers.openrewrite.testngtojupiter.helper.UsesAnnotation;
import org.jetbrains.annotations.NotNull;
import org.openrewrite.*;
import org.openrewrite.java.*;
import org.openrewrite.java.tree.J;

import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;

public class MigrateDataProvider extends Recipe {
Expand Down Expand Up @@ -85,22 +81,5 @@ public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, or

return classDecl;
}

private static @NotNull Optional<String> findProviderNameFromParameter(J.MethodDeclaration provider) {
return provider.getLeadingAnnotations().stream()
.filter(DATAPROVIDER_MATCHER::matches)
.map(J.Annotation::getArguments)
.filter(Objects::nonNull)
.flatMap(Collection::stream)
.filter(J.Assignment.class::isInstance)
.map(J.Assignment.class::cast)
.filter(a -> "name".equals(((J.Identifier) a.getVariable()).getSimpleName()))
.map(J.Assignment::getAssignment)
.filter(J.Literal.class::isInstance)
.map(J.Literal.class::cast)
.map(J.Literal::getValue)
.map(Objects::toString)
.findAny();
}
}
}

0 comments on commit 97f567b

Please sign in to comment.