springboot2.0以后的junit


只需要引入:

<dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>

就可以可以單元測試:

/**
* 測試類
*/
public class App {

   @Test
   public void test(){
       //目標對象
       UserDao target = new UserDao();

       //代理對象
       UserDao proxy = (UserDao)new ProxyFactory(target).getProxyInstance();

       //執行代理對象的方法
       proxy.save();
   }
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM