首页 分享 No tests found matching [{ExactMatcher:fDisplayName=findByname(java.la

No tests found matching [{ExactMatcher:fDisplayName=findByname(java.la

来源:花匠小妙招 时间:2024-12-25 03:27

最新推荐文章于 2023-06-27 23:19:03 发布

宝石男孩 于 2018-12-04 15:07:44 发布

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

@Test

public void findHerb(String name) {

String xmlPath="applicationContext.xml";

ApplicationContext applicationContext=new ClassPathXmlApplicationContext(xmlPath);

HerbService herbService=applicationContext.getBean("herbService",HerbService.class);

List<Herb> list=(List<Herb>) herbService.findByName("甘草");

for(Herb herb : list) {

System.out.println(herb);

}

}

之前写的test方法,,,,写了测试一遍然后就报错了。惊了,之前的方法都可以测试,也不是没有加@test,网上也全是说

1.是不是没有加@test

2.没有build path Junit

3.方法跟test冲突了

但是我的情况都不是这样的。

偶然看到一位老哥的评论:test的方法里面不能写参数?????为什么呀?

@Test

public void findHerb() {

String xmlPath="applicationContext.xml";

ApplicationContext applicationContext=new ClassPathXmlApplicationContext(xmlPath);

HerbService herbService=applicationContext.getBean("herbService",HerbService.class);

List<Herb> list=(List<Herb>) herbService.findByName("甘草");

for(Herb herb : list) {

System.out.println(herb);

}

}

改了之后成功了。。。。

哪位大佬看见了的话,可以解释下吗?

相关知识

番茄花叶病毒番茄分离物与烟草花叶病毒蚕豆分离物生物学、血清学比较及PCR特异性检测
matplotlib字体查找机制探索
Nothing found for Roll 2020 07 30 118778
Analysis on the Genetic Diversity of Peanut Varieties in Regional Tests of Southern China
两种芳香植物精油蒸馏提取工艺
香叶天竺葵精油和罗勒精油的抗抑郁功效及其作用机制研究
静态资源无法找到(No mapping found for HTTP request with URI)问题
Matching and Optimization of the Strength and Stiffness of a Driven Axle Under Asymmetrical Load
认知和情感共情与负性情绪:情绪调节的作用机制
食品过敏原检测

网址: No tests found matching [{ExactMatcher:fDisplayName=findByname(java.la https://www.huajiangbk.com/newsview1275568.html

所属分类:花卉
上一篇: 「鼻尖上的世界」植物精油知多少—
下一篇: 陪娃写作业=玩命?第一批80后已

推荐分享