|
28 | 28 | import java.util.function.Function;
|
29 | 29 | import java.util.stream.IntStream;
|
30 | 30 |
|
31 |
| -import org.assertj.core.api.Assertions; |
32 |
| -import org.assertj.core.api.SoftAssertions; |
33 | 31 | import org.junit.jupiter.api.Test;
|
34 | 32 | import org.springframework.beans.factory.annotation.Autowired;
|
35 | 33 | import org.springframework.context.ApplicationContext;
|
36 |
| -import org.springframework.context.ApplicationEventPublisher; |
37 | 34 | import org.springframework.context.annotation.Bean;
|
38 | 35 | import org.springframework.context.annotation.Configuration;
|
39 | 36 | import org.springframework.context.annotation.Import;
|
|
54 | 51 | import org.springframework.data.jdbc.testing.TestClass;
|
55 | 52 | import org.springframework.data.jdbc.testing.TestConfiguration;
|
56 | 53 | import org.springframework.data.jdbc.testing.TestDatabaseFeatures;
|
57 |
| -import org.springframework.data.mapping.callback.EntityCallbacks; |
58 | 54 | import org.springframework.data.mapping.context.InvalidPersistentPropertyPath;
|
59 | 55 | import org.springframework.data.relational.core.conversion.DbActionExecutionException;
|
60 | 56 | import org.springframework.data.relational.core.mapping.Column;
|
@@ -1332,20 +1328,20 @@ void mapWithEnumKey() {
|
1332 | 1328 | assertThat(enumMapOwners).containsExactly(enumMapOwner);
|
1333 | 1329 | }
|
1334 | 1330 |
|
1335 |
| - @Test //GH-2064 |
| 1331 | + @Test // GH-2064 |
1336 | 1332 | void saveAllBeforeConvertCallback() {
|
1337 |
| - var first = new BeforeConvertCallbackForSaveBatch("first"); |
1338 |
| - var second = new BeforeConvertCallbackForSaveBatch("second"); |
1339 |
| - var third = new BeforeConvertCallbackForSaveBatch("third"); |
| 1333 | + |
| 1334 | + BeforeConvertCallbackForSaveBatch first = new BeforeConvertCallbackForSaveBatch("first"); |
| 1335 | + BeforeConvertCallbackForSaveBatch second = new BeforeConvertCallbackForSaveBatch("second"); |
| 1336 | + BeforeConvertCallbackForSaveBatch third = new BeforeConvertCallbackForSaveBatch("third"); |
1340 | 1337 |
|
1341 | 1338 | template.saveAll(List.of(first, second, third));
|
1342 | 1339 |
|
1343 |
| - var allEntriesInTable = template.findAll(BeforeConvertCallbackForSaveBatch.class); |
| 1340 | + List<BeforeConvertCallbackForSaveBatch> allEntriesInTable = template |
| 1341 | + .findAll(BeforeConvertCallbackForSaveBatch.class); |
1344 | 1342 |
|
1345 |
| - Assertions.assertThat(allEntriesInTable) |
1346 |
| - .hasSize(3) |
1347 |
| - .extracting(BeforeConvertCallbackForSaveBatch::getName) |
1348 |
| - .containsOnly("first", "second", "third"); |
| 1343 | + assertThat(allEntriesInTable).hasSize(3).extracting(BeforeConvertCallbackForSaveBatch::getName) |
| 1344 | + .containsExactlyInAnyOrder("first", "second", "third"); |
1349 | 1345 | }
|
1350 | 1346 |
|
1351 | 1347 | @Test // GH-1684
|
@@ -2175,9 +2171,8 @@ public String getId() {
|
2175 | 2171 | return id;
|
2176 | 2172 | }
|
2177 | 2173 |
|
2178 |
| - public BeforeConvertCallbackForSaveBatch setId(String id) { |
| 2174 | + public void setId(String id) { |
2179 | 2175 | this.id = id;
|
2180 |
| - return this; |
2181 | 2176 | }
|
2182 | 2177 |
|
2183 | 2178 | public String getName() {
|
@@ -2215,12 +2210,14 @@ static class WithIdOnly {
|
2215 | 2210 |
|
2216 | 2211 | @Table
|
2217 | 2212 | static class WithInsertOnly {
|
| 2213 | + |
2218 | 2214 | @Id Long id;
|
2219 | 2215 | @InsertOnlyProperty String insertOnly;
|
2220 | 2216 | }
|
2221 | 2217 |
|
2222 | 2218 | @Table
|
2223 | 2219 | static class MultipleCollections {
|
| 2220 | + |
2224 | 2221 | @Id Long id;
|
2225 | 2222 | String name;
|
2226 | 2223 | List<ListElement> listElements = new ArrayList<>();
|
|
0 commit comments