问答详情
源自:2-1 IOC及Bean容器

IDEA如何进行Junit单元测试?

虽然网上有IDEA进行Junit单元测试的例子,但是都与视频中老师做的不一样。可有大佬分享一下IDEA做Junit单元测试方法的,谢谢

提问者:WalkureAttack 2017-12-28 21:04

个回答

  • qq_笨笨_2017
    2017-12-29 14:01:47

    1. idea中先加入maven

    2. 在pom文件中添加:

      <dependencies>
         <!-- https://mvnrepository.com/artifact/junit/junit -->
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <version>4.12</version>
             <scope>test</scope>
         </dependency>
      </dependencies>

    3. 然后maven会帮你自动给去下载junit的包