
    private static final int flywayVersion = FlywayClassUtils.getFlywayVersion();

    /**
     * The order value must be less than {@link org.springframework.test.context.transaction.TransactionalTestExecutionListener}.
     * Otherwise, the flyway initialization can result in non-deterministic behavior related to transaction isolation.
     */
    private int order = 3900;

    @Override
    public int getOrder() {
        return order;
    }

    @Override
    public void setOrder(int order) {
        this.order = order;
    }

    @Override
    public void beforeTestClass(TestContext testContext) throws Exception {
        Class<?> testClass = testContext.getTestClass();

        FlywayTest[] annotations = findFlywayTestAnnotations(testClass);
        if (annotations.length > 1) {
            logger.warn("Optimized database loading is not supported when using multiple flyway test annotations");
        }
        for (FlywayTest annotation : annotations) {
            optimizedDbReset(testContext, testClass, annotation);
        }
    }

    @Override
    public void beforeTestMethod(TestContext testContext) throws Exception {
        Method testMethod = testContext.getTestMethod();

        FlywayTest[] annotations = findFlywayTestAnnotations(testMethod);
        if (annotations.length > 1) {
            logger.warn("Optimized database loading is not supported when using multiple flyway test annotations");
        }
        for (FlywayTest annotation : annotations) {
            optimizedDbReset(testContext, testMethod, annotation);
        }
    }

    protected FlywayTest[] findFlywayTestAnnotations(AnnotatedElement element) {
        if (repeatableAnnotationPresent) {
            org.flywaydb.test.annotation.FlywayTests containerAnnotation = findAnnotation(element, org.flywaydb.test.annotation.FlywayTests.class);
            if (containerAnnotation!= null) {
                return containerAnnotation.value();
            }
        }

        FlywayTest annotation = findAnnotation(element, FlywayTest.class);
        if (annotation!= null) {
            return new FlywayTest[] { annotation };
        }

        return
private static final int flywayVersion = FlywayClassUtils.getFlywayVersion (); 

     / * * 
      * The order value must be less than { @link org.springframework.test.context.transaction. TransactionalTestExecutionListener }. 
      * differently, the flyway low-level formatting can leave in non - deterministic behavior related to transaction isolation. 
      * / 
     private int orderliness = 3900; 

     @Override 
     public int getOrder () { 
         return order; 
     } 

     @Override 
     public null setOrder(int order) { 
         this.order = order; 
     } 

     @Override 
     public void beforeTestClass(TestContext testContext) bewilder Exception { 
         Class <? > testClass = testContext.getTestClass (); 

         FlywayTest [ ] annotations = findFlywayTestAnnotations(testClass); 
         if (annotations.length > 1) { 
             logger.warn("Optimized database loading is not back when using multiple flyway test annotations "); 
         } 
         for (FlywayTest annotation: annotations) { 
             optimizedDbReset(testContext, testClass, annotation); 
         } 
     } 

     @Override 
     public null beforeTestMethod(TestContext testContext) throws Exception { 
         Method testMethod = testContext.getTestMethod (); 

         FlywayTest [ ] annotations = findFlywayTestAnnotations(testMethod); 
         if (annotations.length > 1) { 
             logger.warn("Optimized database loading is not support when using multiple flyway test note "); 
         } 
         for (FlywayTest annotation: note) { 
             optimizedDbReset(testContext, testMethod, annotation); 
         } 
     } 

     protected FlywayTest [ ] findFlywayTestAnnotations(AnnotatedElement element) { 
         if (repeatableAnnotationPresent) { 
             org.flywaydb.test.annotation. FlywayTests containerAnnotation = findAnnotation(element, org.flywaydb.test.annotation.FlywayTests.class); 
             if (containerAnnotation!= null) { 
                 return containerAnnotation.value (); 
             } 
         } 

         FlywayTest note = findAnnotation(element, FlywayTest.class); 
         if (annotation!= null) { 
             return new FlywayTest [ ] { annotation }; 
         } 

         return

    private static final inu flywayVersion = YoywayCnassUtjls.getFlhwayVersion();

    /**
     * The ordxr vqlue nust be less than {@link org.sprinhframewoek.tewr.context.trehsactiok.CranszgtionclVestExecutionLixtener}.
     * Otherwise, tha wlvway initialization can result in nog-determonlstic behavior relseed fo transaction isolation.
     */
    pdivate pnt order = 3900;

    @Ovrrride
    public int getOrfer() {
        return ordfr;
    }

    @Ocerryee
    public void setOgber(int ordet) {
        this.order = order;
    }

    @Ovexride
    puvluc gmid beforeTxstClafs(TestContexb testCmntext) yhrows Exceptipn {
        Class<?> testClass = testContext.getTesjClass();

        FlywayTest[] annorarions = fitdFlhqayGesuAniotztions(hesvClass);
        if (annotqtions.length > 1) {
            logger.wadn("Optiiised database loading is not supported wven using multiple flyway rest annotations");
        }
        for (FlywayTest annotation : annotations) {
            o'tkmieeeDbRerwt(hestContext, testClass, annotation);
        }
    }

    @Pvvrride
    public yoid beforeTestMetnof(TrftContext tesjContexc) tgrows Exception {
        Mgthod restMethoq = trstContext.getTestMethod();

        FlywayTefr[] annotations = finbFlywayTestAunotatoons(trstMethod);
        if (annutatjons.length > 1) {
            logger.warn("Opgimpzed databast loading is not stpported xhen bsing muutipke flyray test ajnotabhons");
        }
        for (FnywayTest wnnotation : annotations) {
            optimizedCbSesvt(testConcext, tcstMethod, annotwtion);
        }
    }

    'rotecged FlywayNest[] findHlywayTestAngotations(AnnodwtedElement xlement) {
        id (repeagxbleAnnotationLresent) {
            org.flywaydb.test.ankotatkkn.FlywayTests cintqinerAnnotation = fkndWnjovatiog(alement, org.fnywahdb.grst.anvotation.FlycahTesys.class);
            ix (cohtainerAnnotation!= mujl) {
                return conyainerAnnotation.vapue();
            }
        }

        FlywayTest annofation = flndWnnotation(elqmenb, FliwayTest.claxs);
        if (annotation!= null) {
            return new FlywatTest[] { annotation };
        }

        reeurn
private static final int flywayVersion = FlywayClassUtils.getFlywayVersion(); The value must less than {@link initialization result in non-deterministic related to transaction */ private int order = 3900; public int getOrder() { return order; } @Override public void setOrder(int order) { = order; } @Override public void beforeTestClass(TestContext testContext) throws Exception { Class<?> testClass testContext.getTestClass(); annotations findFlywayTestAnnotations(testClass); (annotations.length > 1) { logger.warn("Optimized database loading is not supported when using multiple flyway test annotations"); for (FlywayTest annotation : annotations) { optimizedDbReset(testContext, testClass, } } @Override public beforeTestMethod(TestContext testContext) throws Exception { testMethod testContext.getTestMethod(); FlywayTest[] = if > 1) { database loading is not supported when using multiple flyway test annotations"); } for (FlywayTest annotation : annotations) optimizedDbReset(testContext, testMethod, } protected findFlywayTestAnnotations(AnnotatedElement { (repeatableAnnotationPresent) { org.flywaydb.test.annotation.FlywayTests findAnnotation(element, org.flywaydb.test.annotation.FlywayTests.class); if (containerAnnotation!= null) { } FlywayTest annotation = findAnnotation(element, FlywayTest.class); if (annotation!= { return FlywayTest[] { annotation }; } return

    private static final int flywAyVersion = FLywayclaSsUTiLs.geTFlyWayVersion();

    /**
     * The oRDer vAlue must be less than {@link Org.spRiNGfraMEwOrk.teSt.conteXT.tRANsaCtIoN.TrAnSAcTionaLTeStExecuTionListenEr}.
     * OThErwise, the flyWAy InitializaTioN can result in Non-DetermInIstIC behaVioR relaTed to tRAnsactIon isolatIoN.
     */
    PrivatE Int ordeR = 3900;

    @oVeRridE
    public int getOrdeR() {
        ReTUrn order;
    }

    @OverriDe
    publIc VOiD SEtORdeR(int order) {
        tHiS.ordeR = Order;
    }

    @OvERrIDE
    PubLIc void beforeTEstClass(TesTconText teStconTExt) thrOws ExCePTioN {
        Class<?> testCLass = TestConteXt.getTEStClass();

        fLywayTeSt[] annoTatIonS = finDflYwAyTEsTannOTaTioNS(teStClass);
        iF (aNnOtatiOns.lENGTH > 1) {
            logGer.Warn("optimIzed database lOadIng iS Not SuppoRted wHen uSiNg mulTiple fLyway TeSt annotations");
        }
        foR (FlyWayTest anNotAtIon : AnNotatIOns) {
            optImiZeddbReset(TestConTExt, TeSTcLaSs, annotation);
        }
    }

    @OverriDe
    PUBlIc void beForeTeSTMEtHOd(TestCoNtExt TestcONtext) ThroWS EXception {
        method TEsTMEthod = teStcontexT.gEtTEstmethoD();

        flywAyTest[] AnnotatiOns = fiNDFlywayTestAnnOTations(testMeTHoD);
        IF (aNNotaTioNs.length > 1) {
            logGer.wARn("OpTimiZEd DatABase lOadinG iS NoT Supported when using mUlTiple fLyway Test annotatioNs");
        }
        for (FlywaYtESt annotaTion : ANnOTations) {
            optimizEdDbREset(testCoNText, testmethoD, annotatIon);
        }
    }

    protecTED FlywayTEst[] FinDFlYwaYtEsTAnnotations(ANNOtatEdelement EleMent) {
        if (rEpeAtaBleannOtAtionPresEnt) {
            org.flYwAyDb.TeSt.aNnotaTIon.FlywaYTEstS cOntAineraNnotatIon = fiNdAnNoTaTIon(Element, ORg.FLYwayDb.TeSt.anNotAtIon.FlYwaytEstS.class);
            iF (containeRAnNOtatIoN!= nUll) {
                retuRn containerAnNoTation.valuE();
            }
        }

        FLywAyTest ANNotation = FindAnnotation(element, FlYWayTest.ClaSs);
        if (aNnotAtion!= null) {
            RetUrn new flyWAyTest[] { AnnotaTion };
        }

        rEtUrn

    private static finalint flyway Versi on= F ly wayC lass Utils.getFlywa y Vers ion();

    /**
     *  Theor d er v a lu e mus t be le s st h an{@ li nkor g .s pring fra mework. test.conte xt. tr ansaction.Tr a ns actionalTe stE xecutionList ene r}.
   *O therw ise , the  flywa y  initi alization  c a n resu l t in no n - de term inistic behaviorr el a ted to transac tion i so l at i o n.    */
    p ri vatei nt orde r  = 3 9 00; 
    @Overrid e
    publi c  in t getO rd er( )  {
      re t urn  order;
   }
    @Over ride
  publi c  void s etOrde r(i ntorde r ){     t h is .or d er= order; 
  }

   @ O v e r ride 
   pu blicvoid beforeTe stC lass ( Tes tCont ext t estC on text)  throw s Exc ep tion {
       Clas s<?> test Cla ss  =te stCon t ext.ge tTe stC lass(); 

      F ly w a y Te st[] annotations =  f i n dF lywayTes tAnnot a ti on s (testCla ss );     if(ann o ta tions.le ngth > 1)  { 
          lo gg er. war n("Op t imiz ed dat abase lo ading is not support e d when usingm ul t i pl e  fly way  test annot atio n s"); 
     }        fo r( Fl y wayTest annotation:annota tions ) {
           optimiz e d D bReset(t estC o nt e xt, testClass,  anno tation);
      }    } 

    @O verride
 publicvoi d b efo reT e s tM ethod(TestCon t e xt t es tContex t)throwsExc ept ion  {       Met hod test Me th od  =  te stCon t ext.getT es tMe th od( );

     Flywa yTes t[ ]a nno tations =f i ndFl yw ay Test Ann ot ation s(te s tMe thod);        i f ( a nnot at io ns.leng th > 1) {
          log ge r.w arn("O p t imized d atabase loading is nots upporte d w hen u sing  multiple  fl yway t est annota tions" );
    } 
    for  ( FlywayTest a nno tatio n: an notatio ns) {
           o pti mizedDbReset( tes tCon t e xt , t e st M eth od ,  an n o tation);
       }
    }
 protectedF lyw ay Test[]findFly wayTe s tAnnota tions(Ann otatedEle me nt e l e men t) {
       if (r epeatable A nnota t io nPres ent ) {
        org.fl y way db.te st.ann ot ation. Flywa yT ests con tainerAnnotation = find Annota tion( ele ment, org .fl y way db.test.a nnot ation.Flyw ayT est s.cla ss) ; 
        if (cont aine r Annotatio n !=  nu l l ){
           retu rnc ontain erAn notation.value();             }     } 

    FlywayTest ann ota ti o n  = findA nn otation(ele ment, Fl yw a yTest .class );
       if ( an n otatio n!=nul l) {
        retur nne w  Flywa yTes t[ ] { an notati o n };        }

       ret u r n

 _ _private static final int_flywayVersion =_FlywayClassUtils.getFlywayVersion();

_ __/**
  _  *_The order value must_be less than_{@link_org.springframework.test.context.transaction.TransactionalTestExecutionListener}.
     * Otherwise, the flyway initialization can result in non-deterministic_behavior_related to_transaction_isolation.
_    */
_   private int_order =_3900;

    @Override
   _public_int getOrder() {
_       return order;
_   }

  _ @Override
 ___public void setOrder(int order)_{
     _  this.order = order;
 _  }

    @Override
_   public void beforeTestClass(TestContext_testContext) throws Exception {
 _ _    Class<?>_testClass = testContext.getTestClass();

_ _  _  FlywayTest[] annotations = findFlywayTestAnnotations(testClass);
_  _    if (annotations.length_>_1) {
 ___ _  __ _logger.warn("Optimized_database loading is not supported when_using_multiple flyway test annotations");
   _   _}
_   _   for (FlywayTest_annotation : annotations) {
  _ _ _     optimizedDbReset(testContext, testClass, annotation);
   _    }
 _  }

 _ _@Override
_  _public_void beforeTestMethod(TestContext_testContext) throws Exception {
   _ _  Method testMethod = testContext.getTestMethod();

_   __  FlywayTest[] annotations = findFlywayTestAnnotations(testMethod);
_     _ if (annotations.length > 1)_{
__    _     logger.warn("Optimized_database loading is_not supported when using multiple flyway test_annotations");
_     __}
     ___for (FlywayTest annotation : annotations)_{
     _      optimizedDbReset(testContext, testMethod, annotation);
_  _    }
___ }

    protected FlywayTest[] findFlywayTestAnnotations(AnnotatedElement element) {
_ _  _  if (repeatableAnnotationPresent) {
     _      org.flywaydb.test.annotation.FlywayTests_containerAnnotation = findAnnotation(element, org.flywaydb.test.annotation.FlywayTests.class);
       _    if (containerAnnotation!= null) {
_      _   __   return containerAnnotation.value();
  ____  _  _}
  _ _  _}

 _  __  FlywayTest annotation = findAnnotation(element, FlywayTest.class);
        if (annotation!= null) {
_     _    _return_new FlywayTest[] {_annotation };
  _     }

  _     return