powermock-mockito-demo:使用springboot的powermock-mockito-demo-源码

上传者: 42114580 | 上传时间: 2021-05-02 22:03:04 | 文件大小: 19KB | 文件类型: ZIP
powermock-mockito-demo powermock-mockito-demo with springboot 使用在springboot项目中使用powermock-mockito进行单元测试,演示mock static、private、whenNew、exception的测试。 注意 示例使用spring-boot 2.0.3.RELEASE 它间接引用 junit-4.12 mockito-core-2.15.0 但是官网powermock 1.7.x只支持2.8.0-2.8.9,如果使用默认引入版本,会出现找不到某些方法的异常. 需要自定义mockito-core为相应版本。 ServiceAspect只是为了验证当spy实体在被代理的情况下powermockito是否还会生效。 1、ServiceAspect没有被注释,userService为代理对象,testPr

文件下载

资源详情

[{"title":"( 14 个子文件 19KB ) powermock-mockito-demo:使用springboot的powermock-mockito-demo-源码","children":[{"title":"powermock-mockito-demo-master","children":[{"title":"README.md <span style='color:#111;'> 745B </span>","children":null,"spread":false},{"title":"powermock-mockito-demo","children":[{"title":"pom.xml <span style='color:#111;'> 2.14KB </span>","children":null,"spread":false},{"title":"mvnw <span style='color:#111;'> 6.32KB </span>","children":null,"spread":false},{"title":"src","children":[{"title":"test","children":[{"title":"java","children":[{"title":"com","children":[{"title":"shenhua","children":[{"title":"powermock","children":[{"title":"mockito","children":[{"title":"demo","children":[{"title":"service","children":[{"title":"impl","children":[{"title":"UserServiceImplTest.java <span style='color:#111;'> 4.25KB </span>","children":null,"spread":false}],"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"main","children":[{"title":"resources","children":[{"title":"bootstrap.yml <span style='color:#111;'> 20B </span>","children":null,"spread":false}],"spread":true},{"title":"java","children":[{"title":"com","children":[{"title":"shenhua","children":[{"title":"powermock","children":[{"title":"mockito","children":[{"title":"demo","children":[{"title":"PowermockDemoApplication.java <span style='color:#111;'> 340B </span>","children":null,"spread":false},{"title":"utils","children":[{"title":"IdGenerateUtils.java <span style='color:#111;'> 191B </span>","children":null,"spread":false}],"spread":false},{"title":"exception","children":[{"title":"BusinessException.java <span style='color:#111;'> 386B </span>","children":null,"spread":false}],"spread":false},{"title":"aspect","children":[{"title":"ServiceAspect.java <span style='color:#111;'> 1.19KB </span>","children":null,"spread":false}],"spread":false},{"title":"service","children":[{"title":"UserService.java <span style='color:#111;'> 215B </span>","children":null,"spread":false},{"title":"impl","children":[{"title":"UserServiceImpl.java <span style='color:#111;'> 862B </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"entity","children":[{"title":"UserRule.java <span style='color:#111;'> 220B </span>","children":null,"spread":false},{"title":"User.java <span style='color:#111;'> 735B </span>","children":null,"spread":false}],"spread":false}],"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"mvnw.cmd <span style='color:#111;'> 4.88KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明