<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> </dependency>
package com.zkn.learnspringboot.service.test;
import com.zkn.learnspringboot.FirstExample;
import com.zkn.learnspringboot.service.PersonService;
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.SpringJUnit4ClassRunner;
/**
* Created by wb-zhangkenan on 2016/11/18.
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = FirstExample.class)
public class TestService extends BaseTestService{
@Autowired
private PersonService personService;
@Test
public void testSys() {
System.out.println(personService.getPersonDomain().toString());
}
}
package com.zkn.learnspringboot.service.test;
import com.zkn.learnspringboot.FirstExample;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
* Created by zkn on 2016/11/20.
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = FirstExample.class)
public class BaseTestService {
}
package com.zkn.learnspringboot.service.test;
import com.zkn.learnspringboot.service.PersonService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
/**
* Created by wb-zhangkenan on 2016/11/18.
*/
public class TestService extends BaseTestService{
@Autowired
private PersonService personService;
@Test
public void testSys() {
System.out.println(personService.getPersonDomain().toString());
}
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有