![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
UT
文章平均质量分 60
wuyaowen2000
java技术、php技术、数据库技术爱好者。
展开
-
EasyMock, PowerMock 一起mock静态方法 static method
在哪下载包就不说了,要下这么几个: easymock-3.1 easymockclassextension-3.1 powermock-easymock-junit-1.5 创建一个待会儿被mock的类, Job package com.jwu.mock; import java.util.Random; public class Job { public...原创 2012-12-10 22:41:47 · 969 阅读 · 0 评论 -
mock System class with powermock
Use the @RunWith(PowerMockRunner.class) annotation at the class-level of the test case. Use the @PrepareForTest({ClassThatCallsTheSystemClass.class}) annotation at the class-level of the test ca...原创 2013-12-02 14:13:14 · 394 阅读 · 0 评论