码上敲享录 > SpringBoot常见问题详解 > springboot使用junit测试

springboot使用junit测试

上一章章节目录下一章 2019-11-16已有1228人阅读 评论(0)

springboot使用junit测试


解决方法:

1.pom.xml

<dependency>

           <groupId>org.springframework.boot</groupId>

           <artifactId>spring-boot-starter-test</artifactId>

           <scope>test</scope>

       </dependency>


2.在src\test\java中添加以下测试类,@SpringBootTest(classes = AdminApplication.class) AdminApplication指的是springboot启动类

import org.junit.Test;

import org.junit.runner.RunWith;

import org.springframework.boot.test.context.SpringBootTest;

import org.springframework.test.context.junit4.SpringRunner

@RunWith(SpringRunner.class)

@SpringBootTest(classes = AdminApplication.class)

public class ActivitiTest {

@Test

public void initDeploy(){

}


}


向大家推荐《Activiti工作流实战教程》:https://xiaozhuanlan.com/activiti
0

有建议,请留言!

  • *您的姓名:

  • *所在城市:

  • *您的联系电话:

    *您的QQ:

  • 咨询问题:

  • 提 交