Skip to content

Commit 1291b5d

Browse files
committed
DATAJDBC-131 - Fix unit tests driven by DATAJDBC-144
1 parent 1ae44c0 commit 1291b5d

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/test/java/org/springframework/data/jdbc/core/SqlGeneratorUnitTests.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@
1515
*/
1616
package org.springframework.data.jdbc.core;
1717

18-
import static org.assertj.core.api.Assertions.*;
19-
2018
import java.util.Map;
2119
import java.util.Set;
2220

2321
import org.assertj.core.api.SoftAssertions;
2422
import org.junit.Before;
2523
import org.junit.Test;
24+
2625
import org.springframework.data.annotation.Id;
2726
import org.springframework.data.jdbc.mapping.model.DefaultNamingStrategy;
2827
import org.springframework.data.jdbc.mapping.model.JdbcMappingContext;
@@ -31,6 +30,8 @@
3130
import org.springframework.data.jdbc.mapping.model.NamingStrategy;
3231
import org.springframework.data.mapping.PropertyPath;
3332

33+
import static org.assertj.core.api.Assertions.*;
34+
3435
/**
3536
* Unit tests for the {@link SqlGenerator}.
3637
*
@@ -115,9 +116,9 @@ public void findAllByProperty() {
115116
// this would get called when DummyEntity is the element type of a Set
116117
String sql = sqlGenerator.getFindAllByProperty("back-ref", null);
117118

118-
assertThat(sql).isEqualTo("SELECT DummyEntity.id AS id, DummyEntity.name AS name, "
119-
+ "ref.l1id AS ref_l1id, ref.content AS ref_content, ref.further AS ref_further "
120-
+ "FROM DummyEntity LEFT OUTER JOIN ReferencedEntity AS ref ON ref.DummyEntity = DummyEntity.id "
119+
assertThat(sql).isEqualTo("SELECT DummyEntity.x_id AS x_id, DummyEntity.x_name AS x_name, "
120+
+ "ref.x_l1id AS ref_x_l1id, ref.x_content AS ref_x_content, ref.x_further AS ref_x_further "
121+
+ "FROM DummyEntity LEFT OUTER JOIN ReferencedEntity AS ref ON ref.DummyEntity = DummyEntity.x_id "
121122
+ "WHERE back-ref = :back-ref");
122123
}
123124

@@ -127,10 +128,10 @@ public void findAllByPropertyWithKey() {
127128
// this would get called when DummyEntity is th element type of a Map
128129
String sql = sqlGenerator.getFindAllByProperty("back-ref", "key-column");
129130

130-
assertThat(sql).isEqualTo("SELECT DummyEntity.id AS id, DummyEntity.name AS name, "
131-
+ "ref.l1id AS ref_l1id, ref.content AS ref_content, ref.further AS ref_further, "
131+
assertThat(sql).isEqualTo("SELECT DummyEntity.x_id AS x_id, DummyEntity.x_name AS x_name, "
132+
+ "ref.x_l1id AS ref_x_l1id, ref.x_content AS ref_x_content, ref.x_further AS ref_x_further, "
132133
+ "DummyEntity.key-column AS key-column "
133-
+ "FROM DummyEntity LEFT OUTER JOIN ReferencedEntity AS ref ON ref.DummyEntity = DummyEntity.id "
134+
+ "FROM DummyEntity LEFT OUTER JOIN ReferencedEntity AS ref ON ref.DummyEntity = DummyEntity.x_id "
134135
+ "WHERE back-ref = :back-ref");
135136
}
136137

0 commit comments

Comments
 (0)