|
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.mapping.Column; |
60 | 57 | import org.springframework.data.relational.core.mapping.Embedded; |
@@ -1375,20 +1372,20 @@ void mapWithEnumKey() { |
1375 | 1372 | assertThat(enumMapOwners).containsExactly(enumMapOwner); |
1376 | 1373 | } |
1377 | 1374 |
|
1378 | | - @Test //GH-2064 |
| 1375 | + @Test // GH-2064 |
1379 | 1376 | void saveAllBeforeConvertCallback() { |
1380 | | - var first = new BeforeConvertCallbackForSaveBatch("first"); |
1381 | | - var second = new BeforeConvertCallbackForSaveBatch("second"); |
1382 | | - var third = new BeforeConvertCallbackForSaveBatch("third"); |
| 1377 | + |
| 1378 | + BeforeConvertCallbackForSaveBatch first = new BeforeConvertCallbackForSaveBatch("first"); |
| 1379 | + BeforeConvertCallbackForSaveBatch second = new BeforeConvertCallbackForSaveBatch("second"); |
| 1380 | + BeforeConvertCallbackForSaveBatch third = new BeforeConvertCallbackForSaveBatch("third"); |
1383 | 1381 |
|
1384 | 1382 | template.saveAll(List.of(first, second, third)); |
1385 | 1383 |
|
1386 | | - var allEntriesInTable = template.findAll(BeforeConvertCallbackForSaveBatch.class); |
| 1384 | + List<BeforeConvertCallbackForSaveBatch> allEntriesInTable = template |
| 1385 | + .findAll(BeforeConvertCallbackForSaveBatch.class); |
1387 | 1386 |
|
1388 | | - Assertions.assertThat(allEntriesInTable) |
1389 | | - .hasSize(3) |
1390 | | - .extracting(BeforeConvertCallbackForSaveBatch::getName) |
1391 | | - .containsOnly("first", "second", "third"); |
| 1387 | + assertThat(allEntriesInTable).hasSize(3).extracting(BeforeConvertCallbackForSaveBatch::getName) |
| 1388 | + .containsExactlyInAnyOrder("first", "second", "third"); |
1392 | 1389 | } |
1393 | 1390 |
|
1394 | 1391 | @Test // GH-1684 |
@@ -2218,9 +2215,8 @@ public String getId() { |
2218 | 2215 | return id; |
2219 | 2216 | } |
2220 | 2217 |
|
2221 | | - public BeforeConvertCallbackForSaveBatch setId(String id) { |
| 2218 | + public void setId(String id) { |
2222 | 2219 | this.id = id; |
2223 | | - return this; |
2224 | 2220 | } |
2225 | 2221 |
|
2226 | 2222 | public String getName() { |
@@ -2258,12 +2254,14 @@ static class WithIdOnly { |
2258 | 2254 |
|
2259 | 2255 | @Table |
2260 | 2256 | static class WithInsertOnly { |
| 2257 | + |
2261 | 2258 | @Id Long id; |
2262 | 2259 | @InsertOnlyProperty String insertOnly; |
2263 | 2260 | } |
2264 | 2261 |
|
2265 | 2262 | @Table |
2266 | 2263 | static class MultipleCollections { |
| 2264 | + |
2267 | 2265 | @Id Long id; |
2268 | 2266 | String name; |
2269 | 2267 | List<ListElement> listElements = new ArrayList<>(); |
|
0 commit comments