@RunWith(SpringRunner.class)
@SpringBootTest
public class BusinessTest {
@Test
public void getList() {
System.out.println("aaaaaaaaaa");
}
}

改成

@RunWith(SpringRunner.class)
@SpringBootTest(classes=BusinessService.class)//这里的BusinessService.class指要测试的类
public class BusinessTest {
@Test
public void getList() {
System.out.println("aaaaaaaaaa");
}
}

就可以了

JUnit报错 java.lang.Exception:No tests found matching的更多相关文章

  1. 谈一谈JUnit神奇的报错 java.lang.Exception:No tests found matching

    最近在学习Spring+SpringMVC+MyBatis,一个人的挖掘过程确实有点艰难,尤其是有一些神奇的报错让你会很蛋疼.特别是接触一些框架还是最新版本的时候,会因为版本问题出现很多错误,欢迎大家 ...

  2. 使用 JUnit 报错 java.lang.Exception: No runnable methods

    错误详情如下: java.lang.Exception: No runnable methods at org.junit.runners.BlockJUnit4ClassRunner.validat ...

  3. junit test 报错,java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=esopCreateTest],

    java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=esopCreateTest], {ExactMatc ...

  4. java.lang.Exception: No tests found matching Method tes(com.bw.test.Testrefiect) from org.junit.vintage.engine.descriptor.RunnerRequest@3bfdc050 at org.junit.internal.requests.FilterRequest.getRunner

    junit   方法  没有加上注解  @Test java.lang.Exception: No tests found matching Method tes(com.bw.test.Testre ...

  5. java.lang.Exception: No tests found matching(Junit测试异常)

    java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=save], {ExactMatcher:fDispl ...

  6. 错误:java.lang.Exception: No tests found matching Method testPrePage1(egou_manager_web.TestEBrand) from org.junit.internal.requests.ClassRequest@4f3cc73c

    今天测试分页时出现以下错误: java.lang.Exception: No tests found matching Method testPrePage1(egou_manager_web.Tes ...

  7. java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=test]解决办法

    在进行简单的Junit单元测试时,测试一直报错: 先来看一下我的单元测试类: import org.junit.Test; import org.junit.runner.RunWith; impor ...

  8. 测试--错误java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=select], {ExactMatcher:fDisplayName=select(com.rjj.demo.DemoApplicationTests)]...

    异常这个错误java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=select], {ExactMatche ...

  9. 关于java.lang.Exception:No tests found matching的一系列解决方法

    问题描述: java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=yahaa], {ExactMatcher ...

随机推荐

  1. PAT 1057 数零壹

    https://pintia.cn/problem-sets/994805260223102976/problems/994805270914383872 给定一串长度不超过 10​5​​ 的字符串, ...

  2. Minor GC vs Major GC vs Full GC

    http://www.importnew.com/15820.html https://plumbr.io/blog/garbage-collection/minor-gc-vs-major-gc-v ...

  3. oracle11.2.0.1 deferred_segment_creation 造成exp imp 空表无法导出的问题

     oracle11g 新增加了 deferred_segment_creation 的属性在创建的数据库表中,如果表中没有数据,并且这个参数是true的话,并不是直接就在数据文件中的增加相应的segm ...

  4. Smarty 变量修饰器

    为了更方便的实现 功能与显示分离,通常会用 smarty 将功能代码中的数据 assign 到页面中,在页面中合理使用 smarty 的修饰方法,会使页面显示更美观! 一个数据可同时使用多个修饰函数, ...

  5. ubuntu安装steam

    增加第三方自由库的软件支持 sudo add-apt-repository multiverse 增加更新支持包 sudo add-apt-repository multiverse 安装steam ...

  6. 请求与响应编码及jsp基本原理

    1.请求转发和请求包含 (1)请求转发: this.getServletContext().getRequestDispatcher("").forward(request,res ...

  7. 周刷题第二期总结(Longest Substring Without Repeating Characters and Median of Two Sorted Arrays)

    这周前面刷题倒是蛮开心,后面出了很多别的事情和问题就去忙其他的,结果又只完成了最低目标. Lonest Substring Without Repeating Characters: Given a ...

  8. SpringBoot(十五)_springboot实现预览pdf

    最近,项目上要做个打印的东西,还要预览.我想就直接生成pdf预览,然后用户选择打印 于是,昨天找了找资料.一般用itext 进行转pdf.于是我就用springboot试了试,代码比较简单,现在只是简 ...

  9. SQL ROUND函数的使用

    SQL ROUND函数的使用   SQL ROUND函数是对数据进行制定精度的取值. 第一个参数是取值的数据,第二个参数是精度,第三个参数是数据取值模式(四舍五入还是截断),其中第三个参数是可选参数, ...

  10. Java之Array(数组)说明

    代码说明: package array; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** ...