Fix tests for #1016

This commit is contained in:
Rob Bygrave
2017-04-30 22:56:07 +12:00
parent 54ef0e7465
commit e51f7f11f1
@@ -3,8 +3,9 @@ package io.ebeaninternal.server.expression;
import io.ebean.BaseTestCase;
import io.ebean.Ebean;
import io.ebean.Query;
import org.tests.model.basic.Customer;
import org.junit.Test;
import org.tests.model.basic.Customer;
import org.tests.model.onetoone.album.Cover;
import static org.assertj.core.api.Assertions.assertThat;
@@ -25,6 +26,16 @@ public class NoopExpressionTest extends BaseTestCase {
assertThat(generatedSql).contains("select t0.id from o_customer t0 where 1=1");
}
@Test
public void test_withSoftDeleteBean() {
Query<Cover> query = Ebean.find(Cover.class)
.where().add(NoopExpression.INSTANCE)
.query();
query.findCount();
}
@Test
public void test_withPreAndPost() {
@@ -38,7 +49,7 @@ public class NoopExpressionTest extends BaseTestCase {
query.findList();
String generatedSql = sqlOf(query);
assertThat(generatedSql).contains("select t0.id from o_customer t0 where t0.name is null and 1=1 and t0.status is not null");
assertThat(generatedSql).contains("select t0.id from o_customer t0 where t0.name is null and 1=1 and t0.status is not null");
}
@Test