|
@@ -10,6 +10,7 @@ import org.springframework.test.context.ContextConfiguration;
|
|
|
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
|
|
|
|
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
|
+import com.baomidou.mybatisplus.plugins.Page;
|
|
|
import com.baomidou.mybatisplus.test.oracle.config.OracleDBConfig;
|
|
|
import com.baomidou.mybatisplus.test.oracle.config.OracleMybatisPlusConfig;
|
|
|
import com.baomidou.mybatisplus.test.oracle.entity.TestSequser;
|
|
@@ -55,8 +56,17 @@ public class OracleUserTest {
|
|
|
sequserMapper.insert(user);
|
|
|
Long id = user.getId();
|
|
|
Assert.assertNotNull(id);
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
+ @Test
|
|
|
+ public void testPagination() {
|
|
|
+ Page<TestSequser> page = new Page<>(1, 10);
|
|
|
+ EntityWrapper<TestSequser> ew = new EntityWrapper<>();
|
|
|
+ ew.orderBy("TEST_ID");
|
|
|
+ List<TestSequser> list = sequserMapper.selectPage(page, ew);
|
|
|
+ System.out.println("Id in DB: 1,2,3,4,5,6,7,8,9,10");
|
|
|
+ Assert.assertEquals("Id should start from 1", 1, list.get(0).getId().longValue());
|
|
|
+ Assert.assertEquals("Id should end with 10", 10, list.get(9).getId().longValue());
|
|
|
}
|
|
|
|
|
|
}
|