You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
885 B
37 lines
885 B
|
|
|
|
package com.gaotao;
|
|
|
|
import com.gaotao.service.DynamicDataSourceTestService;
|
|
import org.junit.jupiter.api.Test;
|
|
import org.junit.jupiter.api.extension.ExtendWith;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
import org.springframework.test.context.junit.jupiter.SpringExtension;
|
|
|
|
/**
|
|
* 多数据源测试
|
|
*
|
|
*
|
|
*/
|
|
@ExtendWith(SpringExtension.class)
|
|
@SpringBootTest
|
|
public class DynamicDataSourceTest {
|
|
@Autowired
|
|
private DynamicDataSourceTestService dynamicDataSourceTestService;
|
|
|
|
@Test
|
|
public void test(){
|
|
Long id = 1L;
|
|
id.toString();
|
|
dynamicDataSourceTestService.updateUser(id);
|
|
//dynamicDataSourceTestService.updateUserBySlave1(id);
|
|
//dynamicDataSourceTestService.updateUserBySlave2(id);
|
|
}
|
|
|
|
@Test
|
|
public void test2(){
|
|
|
|
}
|
|
|
|
}
|