Sping-Boot 单元测试

package com.xxx.manager.util;

import java.util.List;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.web.WebAppConfiguration;

//@RunWith(SpringJUnit4ClassRunner.class)
@RunWith(SpringRunner.class)
//@ContextConfiguration(locations = { "classpath:config/spring-resources.xml",
//        "classpath:config/spring-application.xml" })
@SpringBootTest(classes = Application.class)
@WebAppConfiguration
 
 




		<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
		</dependency>



猜你喜欢

转载自blog.csdn.net/oro99/article/details/78059790