读取spring工程中resource的文件
摘要:Resource resource = new ClassPathResource("data.json"); // 读文件到字符串 String fileContent = FileUtils.readFileToString(resource.getFile(), "UTF-8");
阅读全文
posted @
2018-06-13 15:19
harrell
阅读(1918)
推荐(0)
同时使用SpringJUnit4ClassRunner和Parameterized进行参数化
摘要:标题实际上是个不可能完成的任务,因为我们只能用一个Runwith注解,而且只能写一个类,但是我们可以曲线救国,插入下方的5到14行就可以注入了
阅读全文
posted @
2018-06-13 11:57
harrell
阅读(352)
推荐(0)
使注解@ContextConfiguration同时支持locations和classes
摘要:And, in your test code use the following:
阅读全文
posted @
2018-06-12 20:54
harrell
阅读(2442)
推荐(1)