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