|
@@ -16,10 +16,9 @@ import org.junit.BeforeClass;
|
|
|
import org.junit.Test;
|
|
|
import org.junit.runner.RunWith;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.context.ApplicationContext;
|
|
|
-import org.springframework.context.support.ClassPathXmlApplicationContext;
|
|
|
import org.springframework.test.context.ContextConfiguration;
|
|
|
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
|
|
+import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
|
|
|
|
|
|
import com.baomidou.mybatisplus.mapper.Condition;
|
|
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
@@ -42,7 +41,10 @@ public class H2MetaObjAndVersionAndOptLockTest extends H2Test{
|
|
|
@BeforeClass
|
|
|
public static void initDB() throws SQLException, IOException {
|
|
|
@SuppressWarnings("resource")
|
|
|
- ApplicationContext context = new ClassPathXmlApplicationContext("classpath:h2/spring-test-h2-metaobj.xml");
|
|
|
+ AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
|
|
|
+ context.register(DBConfig.class);
|
|
|
+ context.register(MybatisConfigMetaObjOptLockConfig.class);
|
|
|
+ context.refresh();
|
|
|
DataSource ds = (DataSource) context.getBean("dataSource");
|
|
|
try (Connection conn = ds.getConnection()) {
|
|
|
String createTableSql = readFile("user.ddl.sql");
|