From 77995fda0a36df8c940dffbb6af30f30f842e7b9 Mon Sep 17 00:00:00 2001 From: rob bygrave Date: Fri, 9 Oct 2020 10:17:23 +1300 Subject: [PATCH] #2065 - Fix missed tests for - Refactor SQL generation - remove excess whitespace --- .../server/expression/IsEmptyExpressionQueryTest.java | 4 ++-- .../tests/query/TestImplicitJoinOnParentRelationship.java | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ebean-core/src/test/java/io/ebeaninternal/server/expression/IsEmptyExpressionQueryTest.java b/ebean-core/src/test/java/io/ebeaninternal/server/expression/IsEmptyExpressionQueryTest.java index 45e9cb097..dba74742e 100644 --- a/ebean-core/src/test/java/io/ebeaninternal/server/expression/IsEmptyExpressionQueryTest.java +++ b/ebean-core/src/test/java/io/ebeaninternal/server/expression/IsEmptyExpressionQueryTest.java @@ -122,7 +122,7 @@ public class IsEmptyExpressionQueryTest extends BaseTestCase { query.findList(); if (isPostgres()) { - assertThat(sqlOf(query)).contains("select distinct on (t0.id) t0.id from o_customer t0 join contact u1 on u1.customer_id = t0.id where not exists (select 1 from contact_note x where x.contact_id = u1.id)"); + assertThat(sqlOf(query)).contains("select distinct on (t0.id) t0.id from o_customer t0 join contact u1 on u1.customer_id = t0.id where not exists (select 1 from contact_note x where x.contact_id = u1.id)"); } else { assertThat(sqlOf(query)).contains("select distinct t0.id from o_customer t0 join contact u1 on u1.customer_id = t0.id where not exists (select 1 from contact_note x where x.contact_id = u1.id)"); @@ -141,7 +141,7 @@ public class IsEmptyExpressionQueryTest extends BaseTestCase { query.findList(); if (isPostgres()) { - assertThat(sqlOf(query)).contains("select distinct on (t0.id) t0.id from o_customer t0 join contact u1 on u1.customer_id = t0.id where exists (select 1 from contact_note x where x.contact_id = u1.id)"); + assertThat(sqlOf(query)).contains("select distinct on (t0.id) t0.id from o_customer t0 join contact u1 on u1.customer_id = t0.id where exists (select 1 from contact_note x where x.contact_id = u1.id)"); } else { assertThat(sqlOf(query)).contains("select distinct t0.id from o_customer t0 join contact u1 on u1.customer_id = t0.id where exists (select 1 from contact_note x where x.contact_id = u1.id)"); diff --git a/ebean-core/src/test/java/org/tests/query/TestImplicitJoinOnParentRelationship.java b/ebean-core/src/test/java/org/tests/query/TestImplicitJoinOnParentRelationship.java index 5c8abcdeb..c4aa242eb 100644 --- a/ebean-core/src/test/java/org/tests/query/TestImplicitJoinOnParentRelationship.java +++ b/ebean-core/src/test/java/org/tests/query/TestImplicitJoinOnParentRelationship.java @@ -24,7 +24,7 @@ public class TestImplicitJoinOnParentRelationship extends BaseTestCase { query.findList(); if (isPostgres()) { - String expectedSql = "select distinct on (t0.id) t0.id, t0.name from o_customer t0 join o_order u1 on u1.kcustomer_id = t0.id join o_order_detail u2 on u2.order_id = u1.id join o_product u3 on u3.id = u2.product_id where u3.name = ?"; + String expectedSql = "select distinct on (t0.id) t0.id, t0.name from o_customer t0 join o_order u1 on u1.kcustomer_id = t0.id join o_order_detail u2 on u2.order_id = u1.id join o_product u3 on u3.id = u2.product_id where u3.name = ?"; assertThat(sqlOf(query, 1)).contains(expectedSql); } else { @@ -55,7 +55,7 @@ public class TestImplicitJoinOnParentRelationship extends BaseTestCase { query.findList(); if (isPostgres()) { - String expectedSql = "select distinct on (t0.id) t0.id, t0.name from o_customer t0 left join o_order u1 on u1.kcustomer_id = t0.id left join o_order_detail u2 on u2.order_id = u1.id left join o_product u3 on u3.id = u2.product_id where (u3.name = ? or t0.id = ?)"; + String expectedSql = "select distinct on (t0.id) t0.id, t0.name from o_customer t0 left join o_order u1 on u1.kcustomer_id = t0.id left join o_order_detail u2 on u2.order_id = u1.id left join o_product u3 on u3.id = u2.product_id where (u3.name = ? or t0.id = ?)"; assertThat(sqlOf(query, 1)).contains(expectedSql); } else { String expectedSql = "select distinct t0.id, t0.name from o_customer t0 left join o_order u1 on u1.kcustomer_id = t0.id left join o_order_detail u2 on u2.order_id = u1.id left join o_product u3 on u3.id = u2.product_id where (u3.name = ? or t0.id = ?)"; @@ -76,7 +76,7 @@ public class TestImplicitJoinOnParentRelationship extends BaseTestCase { query.findList(); if (isPostgres()) { - String expectedSql = "select distinct on (t0.id) t0.id, t0.name from o_customer t0 left join o_order u1 on u1.kcustomer_id = t0.id left join o_order_detail u2 on u2.order_id = u1.id left join o_product u3 on u3.id = u2.product_id where (u3.name = ? or t0.id = ?)"; + String expectedSql = "select distinct on (t0.id) t0.id, t0.name from o_customer t0 left join o_order u1 on u1.kcustomer_id = t0.id left join o_order_detail u2 on u2.order_id = u1.id left join o_product u3 on u3.id = u2.product_id where (u3.name = ? or t0.id = ?)"; assertThat(sqlOf(query, 1)).contains(expectedSql); } else {