会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
ppjj
博客园
首页
新随笔
联系
管理
上一页
1
···
47
48
49
50
51
52
53
54
55
···
81
下一页
2017年3月20日
前端js文件添加版本号
摘要: 客户端会缓存这些css或js文件,因此每次升级了js或css文件后,改变版本号,客户端浏览器就会重新下载新的js或css文件 ,刷性缓存的作用。大家可能有时候发现修改了样式或者js,刷新的时候不变,就是客户端缓存了css或者js文件,因此加上参数还是有好处的 <link rel="styleshee
阅读全文
posted @ 2017-03-20 11:04 ppjj
阅读(4445)
评论(0)
推荐(0)
2017年3月16日
mockito static method wiki
摘要: https://github.com/powermock/powermock/wiki/MockitoUsage#a-full-example-for-mocking-stubbing--verifying-static-method
阅读全文
posted @ 2017-03-16 14:20 ppjj
阅读(490)
评论(0)
推荐(0)
2017年3月14日
Mockito - Wanted but not invoked: Actually, there were zero interactions with this mock
摘要: 要测试的类:IndexController.java 代码: @Mock private TemplateWrapper templateWrapper = spy(new TemplateWrapper()); @InjectMocks private IndexController contro
阅读全文
posted @ 2017-03-14 14:55 ppjj
阅读(18141)
评论(0)
推荐(0)
2017年3月9日
html中添加freemarker条件判断
摘要: 1.<#if isChanged==1>id="skin_${skins_index*skins?size+skin_index+1}"<#else>id="skin_${skin_index+1}"</#if> 2.<a <#if advitismentFlag == 1>readonly="re
阅读全文
posted @ 2017-03-09 20:31 ppjj
阅读(2274)
评论(0)
推荐(0)
2017年3月7日
java.lang.NoClassDefFoundError: org/junit/rules/TestRule
摘要: 错误原因:通过定位发现是找不到TestRule这个类,检查项目引用的Junit版本为4.7,发现TestRule是在Junit版本4.10后添加的新特性 解决方法:把junit版本由4.7改成4.10
阅读全文
posted @ 2017-03-07 19:32 ppjj
阅读(1137)
评论(0)
推荐(0)
2017年3月6日
mock的时候验证代码行是否执行
摘要: verify(advertismentService).queryAdvitismentInfForApp(baseBOs, false);
阅读全文
posted @ 2017-03-06 20:24 ppjj
阅读(457)
评论(0)
推荐(0)
2017年3月3日
org.mockito.exceptions.misusing.CannotStubVoidMethodWithReturnValue
摘要: 错误原因:mock的时候,不能mock重载的方法 解决方法:直接mock它的父类的方法 org.mockito.exceptions.misusing.CannotStubVoidMethodWithReturnValue: 'flush' is a *void method* and it *ca
阅读全文
posted @ 2017-03-03 14:58 ppjj
阅读(3106)
评论(0)
推荐(0)
mock带参数的构造函数
摘要: @RunWith(PowerMockRunner.class)@PrepareForTest(Helper.class)//1.添加要初始化的类,就是构造函数所在的类public class HelperTest { @Mock private Something mockSomething; @I
阅读全文
posted @ 2017-03-03 11:38 ppjj
阅读(10180)
评论(0)
推荐(0)
2017年3月2日
mock调用返回值是void类型
摘要: //调用void方法 doNothing().when(templateWrapper).process();// doCallRealMethod().when(templateWrapper).process();
阅读全文
posted @ 2017-03-02 15:14 ppjj
阅读(1139)
评论(0)
推荐(0)
2017年3月1日
object is not an instance of declaring class
摘要: 错误原因:invoke方法的时候,应该是类的实例对象,而不是类本身 解决方法:把 PowerMockito.doReturn(index_expect).when(IndexController.class, "processPage", pageCode, request, response, m
阅读全文
posted @ 2017-03-01 17:13 ppjj
阅读(5595)
评论(0)
推荐(0)
上一页
1
···
47
48
49
50
51
52
53
54
55
···
81
下一页
公告