问题描述
我必须参加以下测试课程:
package com.me.myservice.service;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBoottest;
import org.springframework.test.context.junit4.springrunner;
@RunWith(springrunner.class)
@SpringBoottest(classes = MySpringApplication.class,webEnvironment = SpringBoottest.WebEnvironment.RANDOM_PORT)
public class MyServiceServiceTest {
@Autowired
MyServiceService myServiceService;
@Test
public void mytest() {
Double value = myServiceService.execCalc();
Assertions.assertEquals(0D,valor);
}
}
尝试在 Eclipse 中执行时,使用:
Debug As -> Maven test
或使用:
Debug As -> Maven test -> Maven build...
GOAL: test
它完美地运行了我的测试,包括注入、数据库连接和所有应用程序上下文。但它忽略了我所有的断点。
虽然,如果我“正常”运行相同的应用程序,使用:
Debug As -> Maven test -> Maven build...
GOAL: spring-boot:run clean
我所有的断点都会起作用。
任何线索如何使用所有上下文应用程序在 Eclipse 中调试我的测试? 在此先感谢您的帮助。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)