|
@@ -1,14 +1,21 @@
|
|
package com.baomidou.mybatisplus.test;
|
|
package com.baomidou.mybatisplus.test;
|
|
|
|
|
|
|
|
+import org.junit.Assert;
|
|
import org.junit.Test;
|
|
import org.junit.Test;
|
|
|
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
-import java.util.stream.Stream;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
+import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
|
|
public class SqlTest {
|
|
public class SqlTest {
|
|
|
|
|
|
|
|
+ private final ObjectMapper mapper = new ObjectMapper();
|
|
|
|
+
|
|
@Test
|
|
@Test
|
|
- public void test() {
|
|
|
|
- Stream.of(1, 2, 3, 4, 5).collect(Collectors.toList()).toArray();
|
|
|
|
|
|
+ public void testPageJsonDecode() throws Exception {
|
|
|
|
+ String json = "{\"current\":2,\"size\":9,\"ascs\":[\"name\",\"age\",\"qiuqiu\"]}";
|
|
|
|
+ Page page = mapper.readValue(json, Page.class);
|
|
|
|
+ Assert.assertEquals(2, page.getCurrent());
|
|
|
|
+ Assert.assertEquals(9, page.getSize());
|
|
|
|
+ Assert.assertEquals(3, page.ascs().length);
|
|
}
|
|
}
|
|
}
|
|
}
|