IDEA安装Junit5

1.修改为阿里云镜像,加速下载依赖

项目右键选则Maven,选择Open ‘setting.xml’ 所有代码替换成如下代码



    

        
            alimaven
            aliyun maven
            http://maven.aliyun.com/nexus/content/groups/public/
            central
        

        
            uk
            central
            Human Readable Name for this Mirror.
            http://uk.maven.org/maven2/
        

        
            CN
            OSChina Central
            http://maven.oschina.net/content/groups/public/
            central
        

        
            nexus
            internal nexus repository
            
            http://repo.maven.apache.org/maven2
            central
        

    


2.maven导入

 
        
            org.junit.platform
            junit-platform-launcher
            1.2.0
            test
        
        
            org.junit.jupiter
            junit-jupiter-engine
            5.2.0
            test
        
        
            org.junit.vintage
            junit-vintage-engine
            5.2.0
            test
        
    

3.项目导入包

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;
import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.CoreMatchers.*;

开启测试之旅吧!

你可能感兴趣的:(踩坑)