|
@@ -58,12 +58,12 @@ class SelectBodyToPlainSelectTest {
|
|
|
|
|
|
@Test
|
|
|
void testPaginationInterceptorConcatOrderByBefore() {
|
|
|
- String actualSql = PaginationInterceptor
|
|
|
+ String actualSql = new PaginationInterceptor()
|
|
|
.concatOrderBy("select * from test", page);
|
|
|
|
|
|
assertThat(actualSql).isEqualTo("SELECT * FROM test ORDER BY column ASC");
|
|
|
|
|
|
- String actualSqlWhere = PaginationInterceptor
|
|
|
+ String actualSqlWhere = new PaginationInterceptor()
|
|
|
.concatOrderBy("select * from test where 1 = 1", page);
|
|
|
|
|
|
assertThat(actualSqlWhere).isEqualTo("SELECT * FROM test WHERE 1 = 1 ORDER BY column ASC");
|
|
@@ -71,34 +71,34 @@ class SelectBodyToPlainSelectTest {
|
|
|
|
|
|
@Test
|
|
|
void testPaginationInterceptorConcatOrderByFix() {
|
|
|
- String actualSql = PaginationInterceptor
|
|
|
+ String actualSql = new PaginationInterceptor()
|
|
|
.concatOrderBy("select * from test union select * from test2", page);
|
|
|
assertThat(actualSql).isEqualTo("SELECT * FROM test UNION SELECT * FROM test2 ORDER BY column ASC");
|
|
|
|
|
|
- String actualSqlUnionAll = PaginationInterceptor
|
|
|
+ String actualSqlUnionAll = new PaginationInterceptor()
|
|
|
.concatOrderBy("select * from test union all select * from test2", page);
|
|
|
assertThat(actualSqlUnionAll).isEqualTo("SELECT * FROM test UNION ALL SELECT * FROM test2 ORDER BY column ASC");
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
void testPaginationInterceptorConcatOrderByFixWithWhere() {
|
|
|
- String actualSqlWhere = PaginationInterceptor
|
|
|
+ String actualSqlWhere = new PaginationInterceptor()
|
|
|
.concatOrderBy("select * from test where 1 = 1 union select * from test2 where 1 = 1", page);
|
|
|
assertThat(actualSqlWhere).isEqualTo("SELECT * FROM test WHERE 1 = 1 UNION SELECT * FROM test2 WHERE 1 = 1 ORDER BY column ASC");
|
|
|
|
|
|
- String actualSqlUnionAll = PaginationInterceptor
|
|
|
+ String actualSqlUnionAll = new PaginationInterceptor()
|
|
|
.concatOrderBy("select * from test where 1 = 1 union all select * from test2 where 1 = 1 ", page);
|
|
|
assertThat(actualSqlUnionAll).isEqualTo("SELECT * FROM test WHERE 1 = 1 UNION ALL SELECT * FROM test2 WHERE 1 = 1 ORDER BY column ASC");
|
|
|
}
|
|
|
|
|
|
@Test
|
|
|
void testPaginationInterceptorOrderByEmptyColumnFix() {
|
|
|
- String actualSql = PaginationInterceptor
|
|
|
+ String actualSql = new PaginationInterceptor()
|
|
|
.concatOrderBy("select * from test", page);
|
|
|
|
|
|
assertThat(actualSql).isEqualTo("SELECT * FROM test ORDER BY column ASC");
|
|
|
|
|
|
- String actualSqlWhere = PaginationInterceptor
|
|
|
+ String actualSqlWhere = new PaginationInterceptor()
|
|
|
.concatOrderBy("select * from test where 1 = 1", page);
|
|
|
|
|
|
assertThat(actualSqlWhere).isEqualTo("SELECT * FROM test WHERE 1 = 1 ORDER BY column ASC");
|