1919
2020import java .util .List ;
2121import java .util .Optional ;
22+ import java .util .UUID ;
2223
2324import org .junit .jupiter .api .Assertions ;
2425import org .junit .jupiter .api .Test ;
4041import software .xdev .spring .data .eclipse .store .integration .isolated .tests .id .model .CustomerWithIdLongRepository ;
4142import software .xdev .spring .data .eclipse .store .integration .isolated .tests .id .model .CustomerWithIdString ;
4243import software .xdev .spring .data .eclipse .store .integration .isolated .tests .id .model .CustomerWithIdStringRepository ;
44+ import software .xdev .spring .data .eclipse .store .integration .isolated .tests .id .model .CustomerWithIdUuid ;
45+ import software .xdev .spring .data .eclipse .store .integration .isolated .tests .id .model .CustomerWithIdUuidRepository ;
4346import software .xdev .spring .data .eclipse .store .integration .isolated .tests .id .model .CustomerWithPurchase ;
4447import software .xdev .spring .data .eclipse .store .integration .isolated .tests .id .model .CustomerWithPurchaseRepository ;
4548import software .xdev .spring .data .eclipse .store .integration .isolated .tests .id .model .Purchase ;
@@ -60,7 +63,7 @@ public IdTest(final IdTestConfiguration configuration)
6063 }
6164
6265 @ Test
63- void testCreateSingleWithAutoIdInteger (@ Autowired final CustomerWithIdIntegerRepository customerRepository )
66+ void createSingleWithAutoIdInteger (@ Autowired final CustomerWithIdIntegerRepository customerRepository )
6467 {
6568 final CustomerWithIdInteger customer1 = new CustomerWithIdInteger (TestData .FIRST_NAME , TestData .LAST_NAME );
6669 customerRepository .save (customer1 );
@@ -138,7 +141,7 @@ void saveBulkWithAutoIdIntAndHardcodedId(@Autowired final CustomerWithIdIntRepos
138141 * no previous method is called before the test.
139142 */
140143 @ Test
141- void testSaveSingleWithoutAnyPreviousCall (@ Autowired final CustomerWithIdIntegerRepository customerRepository )
144+ void saveSingleWithoutAnyPreviousCall (@ Autowired final CustomerWithIdIntegerRepository customerRepository )
142145 {
143146 restartDatastore (this .configuration );
144147 final CustomerWithIdInteger customer1 = new CustomerWithIdInteger (TestData .FIRST_NAME , TestData .LAST_NAME );
@@ -155,7 +158,7 @@ void testSaveSingleWithoutAnyPreviousCall(@Autowired final CustomerWithIdInteger
155158 }
156159
157160 @ Test
158- void testCreateSingleWithAutoIdIntegerWorkingCopyIdSet (
161+ void createSingleWithAutoIdIntegerWorkingCopyIdSet (
159162 @ Autowired final CustomerWithIdIntegerRepository customerRepository
160163 )
161164 {
@@ -166,7 +169,7 @@ void testCreateSingleWithAutoIdIntegerWorkingCopyIdSet(
166169 }
167170
168171 @ Test
169- void testCreateMultipleWithAutoIdInteger (@ Autowired final CustomerWithIdIntegerRepository customerRepository )
172+ void createMultipleWithAutoIdInteger (@ Autowired final CustomerWithIdIntegerRepository customerRepository )
170173 {
171174 final CustomerWithIdInteger customer1 = new CustomerWithIdInteger (TestData .FIRST_NAME , TestData .LAST_NAME );
172175 customerRepository .save (customer1 );
@@ -186,7 +189,7 @@ void testCreateMultipleWithAutoIdInteger(@Autowired final CustomerWithIdIntegerR
186189 }
187190
188191 @ Test
189- void testCreateMultipleWithAutoIdIntegerSingleFinds (
192+ void createMultipleWithAutoIdIntegerSingleFinds (
190193 @ Autowired final CustomerWithIdIntegerRepository customerRepository
191194 )
192195 {
@@ -208,7 +211,32 @@ void testCreateMultipleWithAutoIdIntegerSingleFinds(
208211 }
209212
210213 @ Test
211- void testCreateSingleWithAutoIdInt (@ Autowired final CustomerWithIdIntRepository customerRepository )
214+ void createMultipleWithAutoIdUuidSingleFinds (
215+ @ Autowired final CustomerWithIdUuidRepository customerRepository
216+ )
217+ {
218+ final CustomerWithIdUuid customer1 = new CustomerWithIdUuid (TestData .FIRST_NAME , TestData .LAST_NAME );
219+ customerRepository .save (customer1 );
220+ final CustomerWithIdUuid customer2 =
221+ new CustomerWithIdUuid (TestData .FIRST_NAME_ALTERNATIVE , TestData .LAST_NAME_ALTERNATIVE );
222+ customerRepository .save (customer2 );
223+
224+ final UUID generatedId1 = customerRepository .findAll ().get (0 ).getId ();
225+ final UUID generatedId2 = customerRepository .findAll ().get (1 ).getId ();
226+
227+ TestUtil .doBeforeAndAfterRestartOfDatastore (
228+ this .configuration ,
229+ () -> {
230+ final Optional <CustomerWithIdUuid > loadedCustomer1 = customerRepository .findById (generatedId1 );
231+ Assertions .assertEquals (customer1 , loadedCustomer1 .get ());
232+ final Optional <CustomerWithIdUuid > loadedCustomer2 = customerRepository .findById (generatedId2 );
233+ Assertions .assertEquals (customer2 , loadedCustomer2 .get ());
234+ }
235+ );
236+ }
237+
238+ @ Test
239+ void createSingleWithAutoIdInt (@ Autowired final CustomerWithIdIntRepository customerRepository )
212240 {
213241 final CustomerWithIdInt customer1 = new CustomerWithIdInt (TestData .FIRST_NAME , TestData .LAST_NAME );
214242 customerRepository .save (customer1 );
@@ -224,7 +252,7 @@ void testCreateSingleWithAutoIdInt(@Autowired final CustomerWithIdIntRepository
224252 }
225253
226254 @ Test
227- void testCreateSingleWithAutoIdString (@ Autowired final CustomerWithIdStringRepository customerRepository )
255+ void createSingleWithAutoIdString (@ Autowired final CustomerWithIdStringRepository customerRepository )
228256 {
229257 final CustomerWithIdString customer1 = new CustomerWithIdString (TestData .FIRST_NAME , TestData .LAST_NAME );
230258 customerRepository .save (customer1 );
@@ -240,7 +268,25 @@ void testCreateSingleWithAutoIdString(@Autowired final CustomerWithIdStringRepos
240268 }
241269
242270 @ Test
243- void testSaveAfterRestartSingleWithAutoIdString (@ Autowired final CustomerWithIdStringRepository customerRepository )
271+ void createSingleWithAutoIdUuid (@ Autowired final CustomerWithIdUuidRepository customerRepository )
272+ {
273+ final CustomerWithIdUuid customer1 = new CustomerWithIdUuid (TestData .FIRST_NAME , TestData .LAST_NAME );
274+ customerRepository .save (customer1 );
275+
276+ final UUID generatedId = customerRepository .findAll ().get (0 ).getId ();
277+
278+ TestUtil .doBeforeAndAfterRestartOfDatastore (
279+ this .configuration ,
280+ () -> {
281+ final Optional <CustomerWithIdUuid > loadedCustomer = customerRepository .findById (generatedId );
282+ Assertions .assertTrue (loadedCustomer .isPresent ());
283+ Assertions .assertEquals (customer1 , loadedCustomer .get ());
284+ }
285+ );
286+ }
287+
288+ @ Test
289+ void saveAfterRestartSingleWithAutoIdString (@ Autowired final CustomerWithIdStringRepository customerRepository )
244290 {
245291 final CustomerWithIdString customer1 = new CustomerWithIdString (TestData .FIRST_NAME , TestData .LAST_NAME );
246292 customerRepository .save (customer1 );
@@ -263,7 +309,7 @@ void testSaveAfterRestartSingleWithAutoIdString(@Autowired final CustomerWithIdS
263309 }
264310
265311 @ Test
266- void testCreateMultipleWithAutoIdString (@ Autowired final CustomerWithIdStringRepository customerRepository )
312+ void createMultipleWithAutoIdString (@ Autowired final CustomerWithIdStringRepository customerRepository )
267313 {
268314 final CustomerWithIdString customer1 = new CustomerWithIdString (TestData .FIRST_NAME , TestData .LAST_NAME );
269315 customerRepository .save (customer1 );
@@ -283,7 +329,7 @@ void testCreateMultipleWithAutoIdString(@Autowired final CustomerWithIdStringRep
283329 }
284330
285331 @ Test
286- void testCreateSingleWithAutoIdLong (@ Autowired final CustomerWithIdLongRepository customerRepository )
332+ void createSingleWithAutoIdLong (@ Autowired final CustomerWithIdLongRepository customerRepository )
287333 {
288334 final CustomerWithIdLong customer1 = new CustomerWithIdLong (TestData .FIRST_NAME , TestData .LAST_NAME );
289335 customerRepository .save (customer1 );
@@ -300,7 +346,7 @@ void testCreateSingleWithAutoIdLong(@Autowired final CustomerWithIdLongRepositor
300346 }
301347
302348 @ Test
303- void testCreateMultipleWithAutoIdLong (@ Autowired final CustomerWithIdLongRepository customerRepository )
349+ void createMultipleWithAutoIdLong (@ Autowired final CustomerWithIdLongRepository customerRepository )
304350 {
305351 final CustomerWithIdLong customer1 = new CustomerWithIdLong (TestData .FIRST_NAME , TestData .LAST_NAME );
306352 customerRepository .save (customer1 );
@@ -323,7 +369,7 @@ void testCreateMultipleWithAutoIdLong(@Autowired final CustomerWithIdLongReposit
323369 }
324370
325371 @ Test
326- void testCreateSingleWithNoAutoIdInteger (
372+ void createSingleWithNoAutoIdInteger (
327373 @ Autowired final CustomerWithIdIntegerNoAutoGenerateRepository customerRepository )
328374 {
329375 final CustomerWithIdIntegerNoAutoGenerate customer1 =
@@ -341,7 +387,7 @@ void testCreateSingleWithNoAutoIdInteger(
341387 }
342388
343389 @ Test
344- void testCreateMultipleWithNoAutoIdInteger (
390+ void createMultipleWithNoAutoIdInteger (
345391 @ Autowired final CustomerWithIdIntegerNoAutoGenerateRepository customerRepository )
346392 {
347393 final CustomerWithIdIntegerNoAutoGenerate customer1 =
@@ -364,7 +410,7 @@ void testCreateMultipleWithNoAutoIdInteger(
364410 }
365411
366412 @ Test
367- void testSaveSingleWithAutoIdInteger (
413+ void saveSingleWithAutoIdInteger (
368414 @ Autowired final CustomerWithIdIntegerRepository customerRepository
369415 )
370416 {
@@ -385,7 +431,7 @@ void testSaveSingleWithAutoIdInteger(
385431 }
386432
387433 @ Test
388- void testSaveSingleWithNoAutoIdInteger (
434+ void saveSingleWithNoAutoIdInteger (
389435 @ Autowired final CustomerWithIdIntegerNoAutoGenerateRepository customerRepository )
390436 {
391437 final CustomerWithIdIntegerNoAutoGenerate customer1 =
@@ -397,7 +443,7 @@ void testSaveSingleWithNoAutoIdInteger(
397443 }
398444
399445 @ Test
400- void testAutoIdWithSubnodeWithId (
446+ void autoIdWithSubnodeWithId (
401447 @ Autowired final CustomerWithPurchaseRepository customerRepository )
402448 {
403449 final String purchaseName = "bag" ;
@@ -419,7 +465,7 @@ void testAutoIdWithSubnodeWithId(
419465 }
420466
421467 @ Test
422- void testAutoIdWithTwoSubnodeWithId (
468+ void autoIdWithTwoSubnodeWithId (
423469 @ Autowired final CustomerWithPurchaseRepository customerRepository )
424470 {
425471 final String purchaseName = "bag" ;
@@ -442,7 +488,7 @@ void testAutoIdWithTwoSubnodeWithId(
442488 }
443489
444490 @ Test
445- void testAutoIdWithTwoSameSubnodesWithSameIdDifferentNod (
491+ void autoIdWithTwoSameSubnodesWithSameIdDifferentNod (
446492 @ Autowired final CustomerWithPurchaseRepository customerRepository )
447493 {
448494 final Purchase purchase = new Purchase ("bag" );
@@ -475,7 +521,7 @@ void testAutoIdWithTwoSameSubnodesWithSameIdDifferentNod(
475521 }
476522
477523 @ Test
478- void testAutoIdWithTwoSameSubnodesWithSameIdSameNode (
524+ void autoIdWithTwoSameSubnodesWithSameIdSameNode (
479525 @ Autowired final CustomerWithPurchaseRepository customerRepository )
480526 {
481527 final Purchase purchase = new Purchase ("bag" );
@@ -498,7 +544,7 @@ void testAutoIdWithTwoSameSubnodesWithSameIdSameNode(
498544 }
499545
500546 @ Test
501- void testReplaceWithId (@ Autowired final CustomerWithIdIntegerNoAutoGenerateRepository customerRepository )
547+ void replaceWithId (@ Autowired final CustomerWithIdIntegerNoAutoGenerateRepository customerRepository )
502548 {
503549 final CustomerWithIdIntegerNoAutoGenerate existingCustomer =
504550 new CustomerWithIdIntegerNoAutoGenerate (1 , TestData .FIRST_NAME , TestData .LAST_NAME );
@@ -523,7 +569,7 @@ void testReplaceWithId(@Autowired final CustomerWithIdIntegerNoAutoGenerateRepos
523569 }
524570
525571 @ Test
526- void testReplaceWithAutoId (@ Autowired final CustomerWithIdIntegerRepository customerRepository )
572+ void replaceWithAutoId (@ Autowired final CustomerWithIdIntegerRepository customerRepository )
527573 {
528574 final CustomerWithIdInteger existingCustomer =
529575 new CustomerWithIdInteger (TestData .FIRST_NAME , TestData .LAST_NAME );
@@ -550,7 +596,7 @@ void testReplaceWithAutoId(@Autowired final CustomerWithIdIntegerRepository cust
550596 }
551597
552598 @ Test
553- void testReplaceWithIdSaveAll (@ Autowired final CustomerWithIdIntegerNoAutoGenerateRepository customerRepository )
599+ void replaceWithIdSaveAll (@ Autowired final CustomerWithIdIntegerNoAutoGenerateRepository customerRepository )
554600 {
555601 final CustomerWithIdIntegerNoAutoGenerate existingCustomer =
556602 new CustomerWithIdIntegerNoAutoGenerate (1 , TestData .FIRST_NAME , TestData .LAST_NAME );
@@ -565,7 +611,7 @@ void testReplaceWithIdSaveAll(@Autowired final CustomerWithIdIntegerNoAutoGenera
565611 }
566612
567613 @ Test
568- void testAddTwoWithId (@ Autowired final CustomerWithIdIntegerNoAutoGenerateRepository customerRepository )
614+ void addTwoWithId (@ Autowired final CustomerWithIdIntegerNoAutoGenerateRepository customerRepository )
569615 {
570616 final CustomerWithIdIntegerNoAutoGenerate existingCustomer =
571617 new CustomerWithIdIntegerNoAutoGenerate (1 , TestData .FIRST_NAME , TestData .LAST_NAME );
@@ -588,7 +634,7 @@ void testAddTwoWithId(@Autowired final CustomerWithIdIntegerNoAutoGenerateReposi
588634 }
589635
590636 @ Test
591- void testIdsInMultipleTransactions (
637+ void idsInMultipleTransactions (
592638 @ Autowired final CustomerWithIdIntegerNoAutoGenerateRepository customerRepository ,
593639 @ Autowired final PlatformTransactionManager transactionManager
594640 )
@@ -626,7 +672,7 @@ void testIdsInMultipleTransactions(
626672 }
627673
628674 @ Test
629- void testIdsInSingleTransactions (
675+ void idsInSingleTransactions (
630676 @ Autowired final CustomerWithIdIntegerNoAutoGenerateRepository customerRepository ,
631677 @ Autowired final PlatformTransactionManager transactionManager
632678 )
0 commit comments