import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.boot.test.context.SpringBootTest;
import org.junit.Test;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = Application.class )//这里是启动类
public class TestXXXService {
@Autowired
private XXXService ...;
//@Test
public void testXXX(){...}
}
SpringBoot框架下基于junit的单元测试类写法
最新推荐文章于 2024-07-16 06:13:38 发布