阅读背景:

springboot 测试用例_xinyuan的专栏_springboot 测试用例

来源:互联网 
package com.xxx.service;

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 com.xxx.common.datasource.DynamicDataSourceHolder;
import com.xxx.customer.CustomerServer;
import com.xxx.customer.service.CustomerLabelService;
import com.xxx.domain.core.customer.label.CustomerLabelInfoVo;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = { CustomerServer.class }) // 指定启动类
public class CustomerLabelServiceImplTest {
	@Autowired
	CustomerLabelService customerLabelService;

	@Test
	public void testOne() {
		System.out.println("test hello 1");
	}

	@Test
	public void testSelectCustomerLabelInfo() {
		DynamicDataSourceHolder.set("RH");
		List<CustomerLabelInfoVo> res = customerLabelService.selectCustomerLabelInfo(1, "1", 1);
		System.out.println(res);
		DynamicDataSourceHolder.remove();
	}

}
package com.xxx.service;

import java.util.List



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: