zoukankan      html  css  js  c++  java
  • SpringBoot2 单元测试类的报错问题

    问题描述

    执行 SpringBoot2 测试时报错,提示找不到 SsmApplicationTests 主类

    原因分析

    Junit5 升级了框架没有兼容

    问题解决

    <!--测试模块-->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-test</artifactId>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.platform</groupId>
                <artifactId>junit-platform-launcher</artifactId>
                <version>1.0.1</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>5.0.1</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.vintage</groupId>
                <artifactId>junit-vintage-engine</artifactId>
                <version>5.5.2</version>
                <scope>test</scope>
            </dependency>
    

    测试类
    org.junit.jupiter.api.Test;
    替换成
    import org.junit.Test;

    作者:Binge
    本文版权归作者和博客园共有,转载必须给出原文链接,并保留此段声明,否则保留追究法律责任的权利。
  • 相关阅读:
    django错误参考
    Pyhton模块学习
    jmeter
    SQL SERVER 2008
    touch的属性
    Sql Server Alter语句
    安装LoadRunner提示缺少vc2005_sp1_with_atl..
    sql语句
    数据库的知识
    十天学会<div+css>横向导航菜单和纵向导航菜单
  • 原文地址:https://www.cnblogs.com/binbingg/p/13863390.html
Copyright © 2011-2022 走看看