Class UpdateBeforeAfterAnnotations


  • public class UpdateBeforeAfterAnnotations
    extends org.openrewrite.Recipe
    This refactor visitor will replace JUnit 4's "Before", "BeforeClass", "After", and "AfterClass" annotations with their JUnit 5 equivalents. Additionally, this visitor will reduce the visibility of methods marked with those annotations to "package" to comply with JUnit 5 best practices.
     org.junit.Before == org.junit.jupiter.api.BeforeEach
     org.junit.After == org.junit.jupiter.api.AfterEach
     org.junit.BeforeClass == org.junit.jupiter.api.BeforeAll
     org.junit.AfterClass == org.junit.jupiter.api.AfterAll
     
    • Field Summary

      • Fields inherited from class org.openrewrite.Recipe

        NOOP
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getDescription()  
      java.lang.String getDisplayName()  
      protected org.openrewrite.TreeVisitor<?,​org.openrewrite.ExecutionContext> getVisitor()  
      • Methods inherited from class org.openrewrite.Recipe

        causesAnotherCycle, doNext, equals, getApplicableTest, getDescriptor, getJacksonPolymorphicTypeTag, getLanguages, getName, getRecipeList, getTags, hashCode, run, run, run, run, validate, validate, validateAll, validateAll, visit
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UpdateBeforeAfterAnnotations

        public UpdateBeforeAfterAnnotations()
    • Method Detail

      • getDisplayName

        public java.lang.String getDisplayName()
        Specified by:
        getDisplayName in class org.openrewrite.Recipe
      • getDescription

        public java.lang.String getDescription()
        Overrides:
        getDescription in class org.openrewrite.Recipe
      • getVisitor

        protected org.openrewrite.TreeVisitor<?,​org.openrewrite.ExecutionContext> getVisitor()
        Overrides:
        getVisitor in class org.openrewrite.Recipe