|
29 | 29 | import java.util.stream.IntStream;
|
30 | 30 | import java.util.stream.Stream;
|
31 | 31 |
|
32 |
| -import org.assertj.core.api.Assertions; |
33 | 32 | import org.junit.jupiter.api.Test;
|
34 | 33 | import org.springframework.beans.factory.annotation.Autowired;
|
35 | 34 | import org.springframework.context.ApplicationContext;
|
36 |
| -import org.springframework.context.ApplicationEventPublisher; |
37 | 35 | import org.springframework.context.annotation.Bean;
|
38 | 36 | import org.springframework.context.annotation.Configuration;
|
39 | 37 | import org.springframework.context.annotation.Import;
|
|
54 | 52 | import org.springframework.data.jdbc.testing.TestClass;
|
55 | 53 | import org.springframework.data.jdbc.testing.TestConfiguration;
|
56 | 54 | import org.springframework.data.jdbc.testing.TestDatabaseFeatures;
|
57 |
| -import org.springframework.data.mapping.callback.EntityCallbacks; |
58 | 55 | import org.springframework.data.mapping.context.InvalidPersistentPropertyPath;
|
59 | 56 | import org.springframework.data.relational.core.conversion.DbActionExecutionException;
|
60 | 57 | import org.springframework.data.relational.core.mapping.Column;
|
@@ -1377,20 +1374,20 @@ void mapWithEnumKey() {
|
1377 | 1374 | assertThat(enumMapOwners).containsExactly(enumMapOwner);
|
1378 | 1375 | }
|
1379 | 1376 |
|
1380 |
| - @Test //GH-2064 |
| 1377 | + @Test // GH-2064 |
1381 | 1378 | void saveAllBeforeConvertCallback() {
|
1382 |
| - var first = new BeforeConvertCallbackForSaveBatch("first"); |
1383 |
| - var second = new BeforeConvertCallbackForSaveBatch("second"); |
1384 |
| - var third = new BeforeConvertCallbackForSaveBatch("third"); |
| 1379 | + |
| 1380 | + BeforeConvertCallbackForSaveBatch first = new BeforeConvertCallbackForSaveBatch("first"); |
| 1381 | + BeforeConvertCallbackForSaveBatch second = new BeforeConvertCallbackForSaveBatch("second"); |
| 1382 | + BeforeConvertCallbackForSaveBatch third = new BeforeConvertCallbackForSaveBatch("third"); |
1385 | 1383 |
|
1386 | 1384 | template.saveAll(List.of(first, second, third));
|
1387 | 1385 |
|
1388 |
| - var allEntriesInTable = template.findAll(BeforeConvertCallbackForSaveBatch.class); |
| 1386 | + List<BeforeConvertCallbackForSaveBatch> allEntriesInTable = template |
| 1387 | + .findAll(BeforeConvertCallbackForSaveBatch.class); |
1389 | 1388 |
|
1390 |
| - Assertions.assertThat(allEntriesInTable) |
1391 |
| - .hasSize(3) |
1392 |
| - .extracting(BeforeConvertCallbackForSaveBatch::getName) |
1393 |
| - .containsOnly("first", "second", "third"); |
| 1389 | + assertThat(allEntriesInTable).hasSize(3).extracting(BeforeConvertCallbackForSaveBatch::getName) |
| 1390 | + .containsExactlyInAnyOrder("first", "second", "third"); |
1394 | 1391 | }
|
1395 | 1392 |
|
1396 | 1393 | @Test // GH-1684
|
@@ -2220,9 +2217,8 @@ public String getId() {
|
2220 | 2217 | return id;
|
2221 | 2218 | }
|
2222 | 2219 |
|
2223 |
| - public BeforeConvertCallbackForSaveBatch setId(String id) { |
| 2220 | + public void setId(String id) { |
2224 | 2221 | this.id = id;
|
2225 |
| - return this; |
2226 | 2222 | }
|
2227 | 2223 |
|
2228 | 2224 | public String getName() {
|
@@ -2260,12 +2256,14 @@ static class WithIdOnly {
|
2260 | 2256 |
|
2261 | 2257 | @Table
|
2262 | 2258 | static class WithInsertOnly {
|
| 2259 | + |
2263 | 2260 | @Id Long id;
|
2264 | 2261 | @InsertOnlyProperty String insertOnly;
|
2265 | 2262 | }
|
2266 | 2263 |
|
2267 | 2264 | @Table
|
2268 | 2265 | static class MultipleCollections {
|
| 2266 | + |
2269 | 2267 | @Id Long id;
|
2270 | 2268 | String name;
|
2271 | 2269 | List<ListElement> listElements = new ArrayList<>();
|
|
0 commit comments