MqReceivertest类无法运行
来源:7-2 RabbitMQ的基本使用(上)

我不想放弃
2020-09-27
https://coding.imooc.com/learn/questiondetail/148098.html
和上面这位同学一样
@Slf4j
@SpringBootTest
@RunWith(SpringRunner.class)
public class MqRecevierTest {
@Autowired
private AmqpTemplate amqpTemplate;
@Test
public void process() {
amqpTemplate.convertAndSend("myQueue","now",new Date());
}
}
抛错
Internal Error occurred.
org.junit.platform.commons.JUnitException: TestEngine with ID ‘junit-vintage’ failed to discover tests
at org.junit.platform.launcher.core.DefaultLauncher.discoverEngineRoot(DefaultLauncher.java:189)
Caused by: org.junit.platform.commons.JUnitException: MethodSelector [className = ‘com.alfielao.order.message.MqRecevierTest’, methodName = ‘process’, methodParameterTypes = ‘’] resolution failed
at org.junit.platform.launcher.listeners.discovery.AbortOnFailureLauncherDiscoveryListener.selectorProcessed(AbortOnFailureLauncherDiscoveryListener.java:39)
Caused by: org.junit.platform.commons.PreconditionViolationException: Could not load class with name: com.alfielao.order.message.MqRecevierTest
Caused by: java.lang.ClassNotFoundException: com.alfielao.order.message.MqRecevierTest
1回答
-
廖师兄
2020-09-30
你用了最新的springBoot版本,pom.xml里有junit-vintage test,把pom.xml的内容改一下,参考课程源码
022020-10-19
SpringCloud Finchley(M2+RELEASE+SR2)微服务实战
5672 学习 · 2489 问题
相似问题