Class MockitoRunnerToMockitoExtension

  • All Implemented Interfaces:
    org.openrewrite.RefactorVisitor<org.openrewrite.Tree>, org.openrewrite.SourceVisitor<org.openrewrite.Tree>

    public class MockitoRunnerToMockitoExtension
    extends org.openrewrite.CompositeRefactorVisitor
    Convert @RunWith(MockitoJUnitRunner.class) and @RunWith(MockitoJUnit44Runner.class) to @ExtendWith(MockitoExtension.class) MockitoJUnitRunner was part of the core library, but the MockitoExtension is in its own module. So this will attempt to add a dependency on mockito-junit-jupiter so that MockitoExtension can be on the classpath. This is part of the JUnit5 upgrade rather than the Mockito upgrade because you'd only need this if you were adopting JUnit5. Mockito can be upgraded from 1 to 3 without this on JUnit 4.
    • Method Summary

      • Methods inherited from class org.openrewrite.CompositeRefactorVisitor

        addVisitor, andThen, defaultTo, extendsFrom, generate, next, validate, visit
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.openrewrite.RefactorVisitor

        isIdempotent, nextCycle
      • Methods inherited from interface org.openrewrite.SourceVisitor

        getCursor, getName, getTags, reduce, visit, visitTree
    • Constructor Detail

      • MockitoRunnerToMockitoExtension

        public MockitoRunnerToMockitoExtension()