Update tests only - handle MySql specifics (boolean literal, lack of order by nulls last)

This commit is contained in:
Rob Bygrave
2016-10-15 00:55:09 +13:00
parent 7c9dda586e
commit 20634233ca
7 changed files with 120 additions and 67 deletions
@@ -1,5 +1,6 @@
package com.avaje.tests.query.softdelete;
import com.avaje.ebean.BaseTestCase;
import com.avaje.ebean.Ebean;
import com.avaje.ebean.PagedList;
import com.avaje.tests.model.onetoone.album.Cover;
@@ -11,7 +12,7 @@ import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
public class TestSoftDeletePagingList {
public class TestSoftDeletePagingList extends BaseTestCase {
@Test
public void test() {
@@ -41,9 +42,17 @@ public class TestSoftDeletePagingList {
assertThat(sql).hasSize(2);
assertThat(sql.get(0)).contains("select count(*) from cover t0 where t0.s3url like");
assertThat(sql.get(0)).contains("and coalesce(t0.deleted,false)=false; --bind(SoftDelPaged-%)");
if (isPlatformBooleanNative()) {
assertThat(sql.get(0)).contains("and coalesce(t0.deleted,false)=false; --bind(SoftDelPaged-%)");
} else {
assertThat(sql.get(0)).contains("and coalesce(t0.deleted,0)=0; --bind(SoftDelPaged-%)");
}
assertThat(sql.get(1)).contains("where t0.s3url like ");
assertThat(sql.get(1)).contains("and coalesce(t0.deleted,false)=false order by t0.id");
if (isPlatformBooleanNative()) {
assertThat(sql.get(1)).contains("and coalesce(t0.deleted,false)=false order by t0.id");
} else {
assertThat(sql.get(1)).contains("and coalesce(t0.deleted,0)=0 order by t0.id");
}
}
}