Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3837254

Browse files
committedFeb 15, 2022
Polishing.
See #1046 Original pull request #1144
1 parent 7babd7a commit 3837254

File tree

4 files changed

+103
-100
lines changed

4 files changed

+103
-100
lines changed
 

‎spring-data-jdbc/src/test/java/org/springframework/data/jdbc/core/JdbcAggregateTemplateIntegrationTests.java

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
@Transactional
9090
@TestExecutionListeners(value = AssumeFeatureTestExecutionListener.class, mergeMode = MERGE_WITH_DEFAULTS)
9191
@ExtendWith(SpringExtension.class)
92-
public class JdbcAggregateTemplateIntegrationTests {
92+
class JdbcAggregateTemplateIntegrationTests {
9393

9494
@Autowired JdbcAggregateOperations template;
9595
@Autowired NamedParameterJdbcOperations jdbcTemplate;
@@ -194,7 +194,7 @@ private static LegoSet createLegoSet(String name) {
194194

195195
@Test // DATAJDBC-112
196196
@EnabledOnFeature(SUPPORTS_QUOTED_IDS)
197-
public void saveAndLoadAnEntityWithReferencedEntityById() {
197+
void saveAndLoadAnEntityWithReferencedEntityById() {
198198

199199
template.save(legoSet);
200200

@@ -216,7 +216,7 @@ public void saveAndLoadAnEntityWithReferencedEntityById() {
216216

217217
@Test // DATAJDBC-112
218218
@EnabledOnFeature(SUPPORTS_QUOTED_IDS)
219-
public void saveAndLoadManyEntitiesWithReferencedEntity() {
219+
void saveAndLoadManyEntitiesWithReferencedEntity() {
220220

221221
template.save(legoSet);
222222

@@ -229,7 +229,7 @@ public void saveAndLoadManyEntitiesWithReferencedEntity() {
229229

230230
@Test // DATAJDBC-101
231231
@EnabledOnFeature(SUPPORTS_QUOTED_IDS)
232-
public void saveAndLoadManyEntitiesWithReferencedEntitySorted() {
232+
void saveAndLoadManyEntitiesWithReferencedEntitySorted() {
233233

234234
template.save(createLegoSet("Lava"));
235235
template.save(createLegoSet("Star"));
@@ -244,7 +244,7 @@ public void saveAndLoadManyEntitiesWithReferencedEntitySorted() {
244244

245245
@Test // DATAJDBC-101
246246
@EnabledOnFeature(SUPPORTS_QUOTED_IDS)
247-
public void saveAndLoadManyEntitiesWithReferencedEntitySortedAndPaged() {
247+
void saveAndLoadManyEntitiesWithReferencedEntitySortedAndPaged() {
248248

249249
template.save(createLegoSet("Lava"));
250250
template.save(createLegoSet("Star"));
@@ -259,7 +259,7 @@ public void saveAndLoadManyEntitiesWithReferencedEntitySortedAndPaged() {
259259

260260
@Test // DATAJDBC-112
261261
@EnabledOnFeature(SUPPORTS_QUOTED_IDS)
262-
public void saveAndLoadManyEntitiesByIdWithReferencedEntity() {
262+
void saveAndLoadManyEntitiesByIdWithReferencedEntity() {
263263

264264
template.save(legoSet);
265265

@@ -271,7 +271,7 @@ public void saveAndLoadManyEntitiesByIdWithReferencedEntity() {
271271

272272
@Test // DATAJDBC-112
273273
@EnabledOnFeature(SUPPORTS_QUOTED_IDS)
274-
public void saveAndLoadAnEntityWithReferencedNullEntity() {
274+
void saveAndLoadAnEntityWithReferencedNullEntity() {
275275

276276
legoSet.setManual(null);
277277

@@ -284,7 +284,7 @@ public void saveAndLoadAnEntityWithReferencedNullEntity() {
284284

285285
@Test // DATAJDBC-112
286286
@EnabledOnFeature(SUPPORTS_QUOTED_IDS)
287-
public void saveAndDeleteAnEntityWithReferencedEntity() {
287+
void saveAndDeleteAnEntityWithReferencedEntity() {
288288

289289
template.save(legoSet);
290290

@@ -300,7 +300,7 @@ public void saveAndDeleteAnEntityWithReferencedEntity() {
300300

301301
@Test // DATAJDBC-112
302302
@EnabledOnFeature(SUPPORTS_QUOTED_IDS)
303-
public void saveAndDeleteAllWithReferencedEntity() {
303+
void saveAndDeleteAllWithReferencedEntity() {
304304

305305
template.save(legoSet);
306306

@@ -316,7 +316,7 @@ public void saveAndDeleteAllWithReferencedEntity() {
316316

317317
@Test // DATAJDBC-112
318318
@EnabledOnFeature({ SUPPORTS_QUOTED_IDS, SUPPORTS_GENERATED_IDS_IN_REFERENCED_ENTITIES })
319-
public void updateReferencedEntityFromNull() {
319+
void updateReferencedEntityFromNull() {
320320

321321
legoSet.setManual(null);
322322
template.save(legoSet);
@@ -335,7 +335,7 @@ public void updateReferencedEntityFromNull() {
335335

336336
@Test // DATAJDBC-112
337337
@EnabledOnFeature(SUPPORTS_QUOTED_IDS)
338-
public void updateReferencedEntityToNull() {
338+
void updateReferencedEntityToNull() {
339339

340340
template.save(legoSet);
341341

@@ -354,7 +354,7 @@ public void updateReferencedEntityToNull() {
354354
}
355355

356356
@Test // DATAJDBC-438
357-
public void updateFailedRootDoesNotExist() {
357+
void updateFailedRootDoesNotExist() {
358358

359359
LegoSet entity = new LegoSet();
360360
entity.setId(100L); // does not exist in the database
@@ -366,7 +366,7 @@ public void updateFailedRootDoesNotExist() {
366366

367367
@Test // DATAJDBC-112
368368
@EnabledOnFeature(SUPPORTS_QUOTED_IDS)
369-
public void replaceReferencedEntity() {
369+
void replaceReferencedEntity() {
370370

371371
template.save(legoSet);
372372

@@ -388,7 +388,7 @@ public void replaceReferencedEntity() {
388388

389389
@Test // DATAJDBC-112
390390
@EnabledOnFeature({ SUPPORTS_QUOTED_IDS, TestDatabaseFeatures.Feature.SUPPORTS_GENERATED_IDS_IN_REFERENCED_ENTITIES })
391-
public void changeReferencedEntity() {
391+
void changeReferencedEntity() {
392392

393393
template.save(legoSet);
394394

@@ -403,7 +403,7 @@ public void changeReferencedEntity() {
403403

404404
@Test // DATAJDBC-266
405405
@EnabledOnFeature(SUPPORTS_QUOTED_IDS)
406-
public void oneToOneChildWithoutId() {
406+
void oneToOneChildWithoutId() {
407407

408408
OneToOneParent parent = new OneToOneParent();
409409

@@ -420,7 +420,7 @@ public void oneToOneChildWithoutId() {
420420

421421
@Test // DATAJDBC-266
422422
@EnabledOnFeature(SUPPORTS_QUOTED_IDS)
423-
public void oneToOneNullChildWithoutId() {
423+
void oneToOneNullChildWithoutId() {
424424

425425
OneToOneParent parent = new OneToOneParent();
426426

@@ -436,7 +436,7 @@ public void oneToOneNullChildWithoutId() {
436436

437437
@Test // DATAJDBC-266
438438
@EnabledOnFeature(SUPPORTS_QUOTED_IDS)
439-
public void oneToOneNullAttributes() {
439+
void oneToOneNullAttributes() {
440440

441441
OneToOneParent parent = new OneToOneParent();
442442

@@ -452,7 +452,7 @@ public void oneToOneNullAttributes() {
452452

453453
@Test // DATAJDBC-125
454454
@EnabledOnFeature(SUPPORTS_QUOTED_IDS)
455-
public void saveAndLoadAnEntityWithSecondaryReferenceNull() {
455+
void saveAndLoadAnEntityWithSecondaryReferenceNull() {
456456

457457
template.save(legoSet);
458458

@@ -465,7 +465,7 @@ public void saveAndLoadAnEntityWithSecondaryReferenceNull() {
465465

466466
@Test // DATAJDBC-125
467467
@EnabledOnFeature(SUPPORTS_QUOTED_IDS)
468-
public void saveAndLoadAnEntityWithSecondaryReferenceNotNull() {
468+
void saveAndLoadAnEntityWithSecondaryReferenceNotNull() {
469469

470470
legoSet.alternativeInstructions = new Manual();
471471
legoSet.alternativeInstructions.content = "alternative content";
@@ -487,7 +487,7 @@ public void saveAndLoadAnEntityWithSecondaryReferenceNotNull() {
487487

488488
@Test // DATAJDBC-276
489489
@EnabledOnFeature(SUPPORTS_QUOTED_IDS)
490-
public void saveAndLoadAnEntityWithListOfElementsWithoutId() {
490+
void saveAndLoadAnEntityWithListOfElementsWithoutId() {
491491

492492
ListParent entity = new ListParent();
493493
entity.name = "name";
@@ -506,7 +506,7 @@ public void saveAndLoadAnEntityWithListOfElementsWithoutId() {
506506

507507
@Test // GH-498 DATAJDBC-273
508508
@EnabledOnFeature(SUPPORTS_QUOTED_IDS)
509-
public void saveAndLoadAnEntityWithListOfElementsInConstructor() {
509+
void saveAndLoadAnEntityWithListOfElementsInConstructor() {
510510

511511
ElementNoId element = new ElementNoId();
512512
element.content = "content";
@@ -521,7 +521,7 @@ public void saveAndLoadAnEntityWithListOfElementsInConstructor() {
521521

522522
@Test // DATAJDBC-259
523523
@EnabledOnFeature(SUPPORTS_ARRAYS)
524-
public void saveAndLoadAnEntityWithArray() {
524+
void saveAndLoadAnEntityWithArray() {
525525

526526
ArrayOwner arrayOwner = new ArrayOwner();
527527
arrayOwner.digits = new String[] { "one", "two", "three" };
@@ -539,7 +539,7 @@ public void saveAndLoadAnEntityWithArray() {
539539

540540
@Test // DATAJDBC-259, DATAJDBC-512
541541
@EnabledOnFeature(SUPPORTS_MULTIDIMENSIONAL_ARRAYS)
542-
public void saveAndLoadAnEntityWithMultidimensionalArray() {
542+
void saveAndLoadAnEntityWithMultidimensionalArray() {
543543

544544
ArrayOwner arrayOwner = new ArrayOwner();
545545
arrayOwner.multidimensional = new String[][] { { "one-a", "two-a", "three-a" }, { "one-b", "two-b", "three-b" } };
@@ -558,7 +558,7 @@ public void saveAndLoadAnEntityWithMultidimensionalArray() {
558558

559559
@Test // DATAJDBC-259
560560
@EnabledOnFeature(SUPPORTS_ARRAYS)
561-
public void saveAndLoadAnEntityWithList() {
561+
void saveAndLoadAnEntityWithList() {
562562

563563
ListOwner arrayOwner = new ListOwner();
564564
arrayOwner.digits.addAll(asList("one", "two", "three"));
@@ -576,7 +576,7 @@ public void saveAndLoadAnEntityWithList() {
576576

577577
@Test // GH-1033
578578
@EnabledOnFeature(SUPPORTS_ARRAYS)
579-
public void saveAndLoadAnEntityWithListOfDouble() {
579+
void saveAndLoadAnEntityWithListOfDouble() {
580580

581581
DoubleListOwner doubleListOwner = new DoubleListOwner();
582582
doubleListOwner.digits.addAll(asList(1.2, 1.3, 1.4));
@@ -594,7 +594,7 @@ public void saveAndLoadAnEntityWithListOfDouble() {
594594

595595
@Test // GH-1033, GH-1046
596596
@EnabledOnFeature(SUPPORTS_ARRAYS)
597-
public void saveAndLoadAnEntityWithListOfFloat() {
597+
void saveAndLoadAnEntityWithListOfFloat() {
598598

599599
FloatListOwner floatListOwner = new FloatListOwner();
600600
final List<Float> values = asList(1.2f, 1.3f, 1.4f);
@@ -613,7 +613,7 @@ public void saveAndLoadAnEntityWithListOfFloat() {
613613

614614
@Test // DATAJDBC-259
615615
@EnabledOnFeature(SUPPORTS_ARRAYS)
616-
public void saveAndLoadAnEntityWithSet() {
616+
void saveAndLoadAnEntityWithSet() {
617617

618618
SetOwner setOwner = new SetOwner();
619619
setOwner.digits.addAll(asList("one", "two", "three"));
@@ -630,7 +630,7 @@ public void saveAndLoadAnEntityWithSet() {
630630
}
631631

632632
@Test // DATAJDBC-327
633-
public void saveAndLoadAnEntityWithByteArray() {
633+
void saveAndLoadAnEntityWithByteArray() {
634634

635635
ByteArrayOwner owner = new ByteArrayOwner();
636636
owner.binaryData = new byte[] { 1, 23, 42 };
@@ -646,7 +646,7 @@ public void saveAndLoadAnEntityWithByteArray() {
646646

647647
@Test // DATAJDBC-340
648648
@EnabledOnFeature(SUPPORTS_QUOTED_IDS)
649-
public void saveAndLoadLongChain() {
649+
void saveAndLoadLongChain() {
650650

651651
Chain4 chain4 = new Chain4();
652652
chain4.fourValue = "omega";
@@ -675,7 +675,7 @@ public void saveAndLoadLongChain() {
675675

676676
@Test // DATAJDBC-359
677677
@EnabledOnFeature(SUPPORTS_QUOTED_IDS)
678-
public void saveAndLoadLongChainWithoutIds() {
678+
void saveAndLoadLongChainWithoutIds() {
679679

680680
NoIdChain4 chain4 = new NoIdChain4();
681681
chain4.fourValue = "omega";
@@ -705,7 +705,7 @@ public void saveAndLoadLongChainWithoutIds() {
705705
}
706706

707707
@Test // DATAJDBC-223
708-
public void saveAndLoadLongChainOfListsWithoutIds() {
708+
void saveAndLoadLongChainOfListsWithoutIds() {
709709

710710
NoIdListChain4 saved = template.save(createNoIdTree());
711711

@@ -716,7 +716,7 @@ public void saveAndLoadLongChainOfListsWithoutIds() {
716716
}
717717

718718
@Test // DATAJDBC-223
719-
public void shouldDeleteChainOfListsWithoutIds() {
719+
void shouldDeleteChainOfListsWithoutIds() {
720720

721721
NoIdListChain4 saved = template.save(createNoIdTree());
722722
template.deleteById(saved.four, NoIdListChain4.class);
@@ -732,7 +732,7 @@ public void shouldDeleteChainOfListsWithoutIds() {
732732
}
733733

734734
@Test // DATAJDBC-223
735-
public void saveAndLoadLongChainOfMapsWithoutIds() {
735+
void saveAndLoadLongChainOfMapsWithoutIds() {
736736

737737
NoIdMapChain4 saved = template.save(createNoIdMapTree());
738738

@@ -743,7 +743,7 @@ public void saveAndLoadLongChainOfMapsWithoutIds() {
743743
}
744744

745745
@Test // DATAJDBC-223
746-
public void shouldDeleteChainOfMapsWithoutIds() {
746+
void shouldDeleteChainOfMapsWithoutIds() {
747747

748748
NoIdMapChain4 saved = template.save(createNoIdMapTree());
749749
template.deleteById(saved.four, NoIdMapChain4.class);
@@ -760,7 +760,7 @@ public void shouldDeleteChainOfMapsWithoutIds() {
760760

761761
@Test // DATAJDBC-431
762762
@EnabledOnFeature(IS_HSQL)
763-
public void readOnlyGetsLoadedButNotWritten() {
763+
void readOnlyGetsLoadedButNotWritten() {
764764

765765
WithReadOnly entity = new WithReadOnly();
766766
entity.name = "Alfred";
@@ -774,7 +774,7 @@ public void readOnlyGetsLoadedButNotWritten() {
774774
}
775775

776776
@Test // DATAJDBC-219 Test that immutable version attribute works as expected.
777-
public void saveAndUpdateAggregateWithImmutableVersion() {
777+
void saveAndUpdateAggregateWithImmutableVersion() {
778778

779779
AggregateWithImmutableVersion aggregate = new AggregateWithImmutableVersion(null, null);
780780
aggregate = template.save(aggregate);
@@ -805,7 +805,7 @@ public void saveAndUpdateAggregateWithImmutableVersion() {
805805
}
806806

807807
@Test // DATAJDBC-219 Test that a delete with a version attribute works as expected.
808-
public void deleteAggregateWithVersion() {
808+
void deleteAggregateWithVersion() {
809809

810810
AggregateWithImmutableVersion aggregate = new AggregateWithImmutableVersion(null, null);
811811
aggregate = template.save(aggregate);
@@ -837,38 +837,38 @@ public void deleteAggregateWithVersion() {
837837
}
838838

839839
@Test // DATAJDBC-219
840-
public void saveAndUpdateAggregateWithLongVersion() {
840+
void saveAndUpdateAggregateWithLongVersion() {
841841
saveAndUpdateAggregateWithVersion(new AggregateWithLongVersion(), Number::longValue);
842842
}
843843

844844
@Test // DATAJDBC-219
845-
public void saveAndUpdateAggregateWithPrimitiveLongVersion() {
845+
void saveAndUpdateAggregateWithPrimitiveLongVersion() {
846846
saveAndUpdateAggregateWithPrimitiveVersion(new AggregateWithPrimitiveLongVersion(), Number::longValue);
847847
}
848848

849849
@Test // DATAJDBC-219
850-
public void saveAndUpdateAggregateWithIntegerVersion() {
850+
void saveAndUpdateAggregateWithIntegerVersion() {
851851
saveAndUpdateAggregateWithVersion(new AggregateWithIntegerVersion(), Number::intValue);
852852
}
853853

854854
@Test // DATAJDBC-219
855-
public void saveAndUpdateAggregateWithPrimitiveIntegerVersion() {
855+
void saveAndUpdateAggregateWithPrimitiveIntegerVersion() {
856856
saveAndUpdateAggregateWithPrimitiveVersion(new AggregateWithPrimitiveIntegerVersion(), Number::intValue);
857857
}
858858

859859
@Test // DATAJDBC-219
860-
public void saveAndUpdateAggregateWithShortVersion() {
860+
void saveAndUpdateAggregateWithShortVersion() {
861861
saveAndUpdateAggregateWithVersion(new AggregateWithShortVersion(), Number::shortValue);
862862
}
863863

864864
@Test // DATAJDBC-219
865-
public void saveAndUpdateAggregateWithPrimitiveShortVersion() {
865+
void saveAndUpdateAggregateWithPrimitiveShortVersion() {
866866
saveAndUpdateAggregateWithPrimitiveVersion(new AggregateWithPrimitiveShortVersion(), Number::shortValue);
867867
}
868868

869869
@Test // DATAJDBC-462
870870
@EnabledOnFeature(SUPPORTS_QUOTED_IDS)
871-
public void resavingAnUnversionedEntity() {
871+
void resavingAnUnversionedEntity() {
872872

873873
LegoSet legoSet = new LegoSet();
874874

@@ -879,7 +879,7 @@ public void resavingAnUnversionedEntity() {
879879

880880
@Test // DATAJDBC-637
881881
@EnabledOnFeature(SUPPORTS_NANOSECOND_PRECISION)
882-
public void saveAndLoadDateTimeWithFullPrecision() {
882+
void saveAndLoadDateTimeWithFullPrecision() {
883883

884884
WithLocalDateTime entity = new WithLocalDateTime();
885885
entity.id = 23L;
@@ -893,7 +893,7 @@ public void saveAndLoadDateTimeWithFullPrecision() {
893893
}
894894

895895
@Test // DATAJDBC-637
896-
public void saveAndLoadDateTimeWithMicrosecondPrecision() {
896+
void saveAndLoadDateTimeWithMicrosecondPrecision() {
897897

898898
WithLocalDateTime entity = new WithLocalDateTime();
899899
entity.id = 23L;
@@ -907,7 +907,7 @@ public void saveAndLoadDateTimeWithMicrosecondPrecision() {
907907
}
908908

909909
@Test // GH-777
910-
public void insertWithIdOnly() {
910+
void insertWithIdOnly() {
911911

912912
WithIdOnly entity = new WithIdOnly();
913913

‎spring-data-jdbc/src/test/java/org/springframework/data/jdbc/core/convert/EntityRowMapperUnitTests.java

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,18 @@
7878
*/
7979
public class EntityRowMapperUnitTests {
8080

81-
public static final long ID_FOR_ENTITY_REFERENCING_MAP = 42L;
82-
public static final long ID_FOR_ENTITY_REFERENCING_LIST = 4711L;
83-
public static final long ID_FOR_ENTITY_NOT_REFERENCING_MAP = 23L;
84-
public static final NamingStrategy X_APPENDING_NAMINGSTRATEGY = new NamingStrategy() {
81+
static final long ID_FOR_ENTITY_REFERENCING_MAP = 42L;
82+
static final long ID_FOR_ENTITY_REFERENCING_LIST = 4711L;
83+
static final long ID_FOR_ENTITY_NOT_REFERENCING_MAP = 23L;
84+
static final NamingStrategy X_APPENDING_NAMINGSTRATEGY = new NamingStrategy() {
8585
@Override
8686
public String getColumnName(RelationalPersistentProperty property) {
8787
return NamingStrategy.super.getColumnName(property).concat("x");
8888
}
8989
};
9090

9191
@Test // DATAJDBC-113
92-
public void simpleEntitiesGetProperlyExtracted() throws SQLException {
92+
void simpleEntitiesGetProperlyExtracted() throws SQLException {
9393

9494
ResultSet rs = mockResultSet(asList("ID", "NAME"), //
9595
ID_FOR_ENTITY_NOT_REFERENCING_MAP, "alpha");
@@ -104,7 +104,7 @@ public void simpleEntitiesGetProperlyExtracted() throws SQLException {
104104
}
105105

106106
@Test // DATAJDBC-181
107-
public void namingStrategyGetsHonored() throws SQLException {
107+
void namingStrategyGetsHonored() throws SQLException {
108108

109109
ResultSet rs = mockResultSet(asList("IDX", "NAMEX"), //
110110
ID_FOR_ENTITY_NOT_REFERENCING_MAP, "alpha");
@@ -119,7 +119,7 @@ public void namingStrategyGetsHonored() throws SQLException {
119119
}
120120

121121
@Test // DATAJDBC-181
122-
public void namingStrategyGetsHonoredForConstructor() throws SQLException {
122+
void namingStrategyGetsHonoredForConstructor() throws SQLException {
123123

124124
ResultSet rs = mockResultSet(asList("IDX", "NAMEX"), //
125125
ID_FOR_ENTITY_NOT_REFERENCING_MAP, "alpha");
@@ -134,7 +134,7 @@ public void namingStrategyGetsHonoredForConstructor() throws SQLException {
134134
}
135135

136136
@Test // DATAJDBC-427
137-
public void simpleWithReferenceGetProperlyExtracted() throws SQLException {
137+
void simpleWithReferenceGetProperlyExtracted() throws SQLException {
138138

139139
ResultSet rs = mockResultSet(asList("ID", "NAME", "TRIVIAL_ID"), //
140140
ID_FOR_ENTITY_NOT_REFERENCING_MAP, "alpha", 100L);
@@ -149,7 +149,7 @@ public void simpleWithReferenceGetProperlyExtracted() throws SQLException {
149149
}
150150

151151
@Test // DATAJDBC-113
152-
public void simpleOneToOneGetsProperlyExtracted() throws SQLException {
152+
void simpleOneToOneGetsProperlyExtracted() throws SQLException {
153153

154154
ResultSet rs = mockResultSet(asList("ID", "NAME", "CHILD_ID", "CHILD_NAME"), //
155155
ID_FOR_ENTITY_NOT_REFERENCING_MAP, "alpha", 24L, "beta");
@@ -164,7 +164,7 @@ public void simpleOneToOneGetsProperlyExtracted() throws SQLException {
164164
}
165165

166166
@Test // DATAJDBC-286
167-
public void immutableOneToOneGetsProperlyExtracted() throws SQLException {
167+
void immutableOneToOneGetsProperlyExtracted() throws SQLException {
168168

169169
ResultSet rs = mockResultSet(asList("ID", "NAME", "CHILD_ID", "CHILD_NAME"), //
170170
ID_FOR_ENTITY_NOT_REFERENCING_MAP, "alpha", 24L, "beta");
@@ -179,7 +179,7 @@ public void immutableOneToOneGetsProperlyExtracted() throws SQLException {
179179
}
180180

181181
@Test // DATAJDBC-427
182-
public void immutableWithReferenceGetsProperlyExtracted() throws SQLException {
182+
void immutableWithReferenceGetsProperlyExtracted() throws SQLException {
183183

184184
ResultSet rs = mockResultSet(asList("ID", "NAME", "TRIVIAL_ID"), //
185185
ID_FOR_ENTITY_NOT_REFERENCING_MAP, "alpha", 100L);
@@ -195,7 +195,7 @@ public void immutableWithReferenceGetsProperlyExtracted() throws SQLException {
195195

196196
// TODO add additional test for multilevel embeddables
197197
@Test // DATAJDBC-111
198-
public void simpleEmbeddedGetsProperlyExtracted() throws SQLException {
198+
void simpleEmbeddedGetsProperlyExtracted() throws SQLException {
199199

200200
ResultSet rs = mockResultSet(asList("ID", "NAME", "PREFIX_ID", "PREFIX_NAME"), //
201201
ID_FOR_ENTITY_NOT_REFERENCING_MAP, "alpha", 24L, "beta");
@@ -210,7 +210,7 @@ public void simpleEmbeddedGetsProperlyExtracted() throws SQLException {
210210
}
211211

212212
@Test // DATAJDBC-113
213-
public void collectionReferenceGetsLoadedWithAdditionalSelect() throws SQLException {
213+
void collectionReferenceGetsLoadedWithAdditionalSelect() throws SQLException {
214214

215215
ResultSet rs = mockResultSet(asList("ID", "NAME"), //
216216
ID_FOR_ENTITY_NOT_REFERENCING_MAP, "alpha");
@@ -225,7 +225,7 @@ public void collectionReferenceGetsLoadedWithAdditionalSelect() throws SQLExcept
225225
}
226226

227227
@Test // DATAJDBC-131
228-
public void mapReferenceGetsLoadedWithAdditionalSelect() throws SQLException {
228+
void mapReferenceGetsLoadedWithAdditionalSelect() throws SQLException {
229229

230230
ResultSet rs = mockResultSet(asList("ID", "NAME"), //
231231
ID_FOR_ENTITY_REFERENCING_MAP, "alpha");
@@ -240,7 +240,7 @@ public void mapReferenceGetsLoadedWithAdditionalSelect() throws SQLException {
240240
}
241241

242242
@Test // DATAJDBC-130
243-
public void listReferenceGetsLoadedWithAdditionalSelect() throws SQLException {
243+
void listReferenceGetsLoadedWithAdditionalSelect() throws SQLException {
244244

245245
ResultSet rs = mockResultSet(asList("ID", "NAME"), //
246246
ID_FOR_ENTITY_REFERENCING_LIST, "alpha");
@@ -255,7 +255,7 @@ public void listReferenceGetsLoadedWithAdditionalSelect() throws SQLException {
255255
}
256256

257257
@Test // DATAJDBC-252
258-
public void doesNotTryToSetPropertiesThatAreSetViaConstructor() throws SQLException {
258+
void doesNotTryToSetPropertiesThatAreSetViaConstructor() throws SQLException {
259259

260260
ResultSet rs = mockResultSet(singletonList("VALUE"), //
261261
"value-from-resultSet");
@@ -268,7 +268,7 @@ public void doesNotTryToSetPropertiesThatAreSetViaConstructor() throws SQLExcept
268268
}
269269

270270
@Test // DATAJDBC-252
271-
public void handlesMixedProperties() throws SQLException {
271+
void handlesMixedProperties() throws SQLException {
272272

273273
ResultSet rs = mockResultSet(asList("ONE", "TWO", "THREE"), //
274274
"111", "222", "333");
@@ -282,7 +282,7 @@ public void handlesMixedProperties() throws SQLException {
282282
}
283283

284284
@Test // DATAJDBC-359
285-
public void chainedEntitiesWithoutId() throws SQLException {
285+
void chainedEntitiesWithoutId() throws SQLException {
286286

287287
// @formatter:off
288288
Fixture<NoIdChain4> fixture = this.<NoIdChain4> buildFixture() //
@@ -318,7 +318,7 @@ public void chainedEntitiesWithoutId() throws SQLException {
318318
}
319319

320320
@Test // DATAJDBC-370
321-
public void simpleNullableImmutableEmbeddedGetsProperlyExtracted() throws SQLException {
321+
void simpleNullableImmutableEmbeddedGetsProperlyExtracted() throws SQLException {
322322

323323
ResultSet rs = mockResultSet(asList("ID", "VALUE", "NAME"), //
324324
ID_FOR_ENTITY_NOT_REFERENCING_MAP, "ru'Ha'", "Alfred");
@@ -334,7 +334,7 @@ public void simpleNullableImmutableEmbeddedGetsProperlyExtracted() throws SQLExc
334334
}
335335

336336
@Test // DATAJDBC-374
337-
public void simpleEmptyImmutableEmbeddedGetsProperlyExtracted() throws SQLException {
337+
void simpleEmptyImmutableEmbeddedGetsProperlyExtracted() throws SQLException {
338338

339339
ResultSet rs = mockResultSet(asList("ID", "VALUE", "NAME"), //
340340
ID_FOR_ENTITY_NOT_REFERENCING_MAP, null, null);
@@ -349,7 +349,7 @@ public void simpleEmptyImmutableEmbeddedGetsProperlyExtracted() throws SQLExcept
349349
}
350350

351351
@Test // DATAJDBC-370
352-
public void simplePrimitiveImmutableEmbeddedGetsProperlyExtracted() throws SQLException {
352+
void simplePrimitiveImmutableEmbeddedGetsProperlyExtracted() throws SQLException {
353353

354354
ResultSet rs = mockResultSet(asList("ID", "VALUE"), //
355355
ID_FOR_ENTITY_NOT_REFERENCING_MAP, 24);
@@ -365,7 +365,7 @@ public void simplePrimitiveImmutableEmbeddedGetsProperlyExtracted() throws SQLEx
365365
}
366366

367367
@Test // DATAJDBC-370
368-
public void simpleImmutableEmbeddedShouldBeNullIfAllOfTheEmbeddableAreNull() throws SQLException {
368+
void simpleImmutableEmbeddedShouldBeNullIfAllOfTheEmbeddableAreNull() throws SQLException {
369369

370370
ResultSet rs = mockResultSet(asList("ID", "VALUE", "NAME"), //
371371
ID_FOR_ENTITY_NOT_REFERENCING_MAP, null, null);
@@ -381,7 +381,7 @@ public void simpleImmutableEmbeddedShouldBeNullIfAllOfTheEmbeddableAreNull() thr
381381
}
382382

383383
@Test // DATAJDBC-370
384-
public void embeddedShouldBeNullWhenFieldsAreNull() throws SQLException {
384+
void embeddedShouldBeNullWhenFieldsAreNull() throws SQLException {
385385

386386
ResultSet rs = mockResultSet(asList("ID", "NAME", "PREFIX_ID", "PREFIX_NAME"), //
387387
ID_FOR_ENTITY_NOT_REFERENCING_MAP, "alpha", null, null);
@@ -396,7 +396,7 @@ public void embeddedShouldBeNullWhenFieldsAreNull() throws SQLException {
396396
}
397397

398398
@Test // DATAJDBC-370
399-
public void embeddedShouldNotBeNullWhenAtLeastOneFieldIsNotNull() throws SQLException {
399+
void embeddedShouldNotBeNullWhenAtLeastOneFieldIsNotNull() throws SQLException {
400400

401401
ResultSet rs = mockResultSet(asList("ID", "NAME", "PREFIX_ID", "PREFIX_NAME"), //
402402
ID_FOR_ENTITY_NOT_REFERENCING_MAP, "alpha", 24, null);
@@ -411,7 +411,7 @@ public void embeddedShouldNotBeNullWhenAtLeastOneFieldIsNotNull() throws SQLExce
411411
}
412412

413413
@Test // DATAJDBC-370
414-
public void primitiveEmbeddedShouldBeNullWhenNoValuePresent() throws SQLException {
414+
void primitiveEmbeddedShouldBeNullWhenNoValuePresent() throws SQLException {
415415

416416
ResultSet rs = mockResultSet(asList("ID", "VALUE"), //
417417
ID_FOR_ENTITY_NOT_REFERENCING_MAP, null);
@@ -427,7 +427,7 @@ public void primitiveEmbeddedShouldBeNullWhenNoValuePresent() throws SQLExceptio
427427
}
428428

429429
@Test // DATAJDBC-370
430-
public void deepNestedEmbeddable() throws SQLException {
430+
void deepNestedEmbeddable() throws SQLException {
431431

432432
ResultSet rs = mockResultSet(asList("ID", "LEVEL0", "LEVEL1_VALUE", "LEVEL1_LEVEL2_VALUE", "LEVEL1_LEVEL2_NAME"), //
433433
ID_FOR_ENTITY_NOT_REFERENCING_MAP, "0", "1", "2", "Rumpelstilzchen");
@@ -442,7 +442,7 @@ public void deepNestedEmbeddable() throws SQLException {
442442
}
443443

444444
@Test // DATAJDBC-341
445-
public void missingValueForObjectGetsMappedToZero() throws SQLException {
445+
void missingValueForObjectGetsMappedToZero() throws SQLException {
446446

447447
ResultSet rs = mockResultSet(singletonList("id"), //
448448
ID_FOR_ENTITY_NOT_REFERENCING_MAP);
@@ -457,7 +457,7 @@ public void missingValueForObjectGetsMappedToZero() throws SQLException {
457457
}
458458

459459
@Test // DATAJDBC-341
460-
public void missingValueForConstructorArgCausesException() throws SQLException {
460+
void missingValueForConstructorArgCausesException() throws SQLException {
461461

462462
ResultSet rs = mockResultSet(singletonList("id"), //
463463
ID_FOR_ENTITY_NOT_REFERENCING_MAP);
@@ -470,7 +470,7 @@ public void missingValueForConstructorArgCausesException() throws SQLException {
470470
}
471471

472472
@Test // DATAJDBC-341
473-
public void missingColumnForPrimitiveGetsMappedToZero() throws SQLException {
473+
void missingColumnForPrimitiveGetsMappedToZero() throws SQLException {
474474

475475
ResultSet rs = mockResultSet(singletonList("id"), //
476476
ID_FOR_ENTITY_NOT_REFERENCING_MAP);
@@ -486,7 +486,7 @@ public void missingColumnForPrimitiveGetsMappedToZero() throws SQLException {
486486
}
487487

488488
@Test // DATAJDBC-341
489-
public void columnNamesAreCaseInsensitive() throws SQLException {
489+
void columnNamesAreCaseInsensitive() throws SQLException {
490490

491491
ResultSet rs = mockResultSet(asList("id", "name"), //
492492
ID_FOR_ENTITY_NOT_REFERENCING_MAP, "alpha");
@@ -501,7 +501,7 @@ public void columnNamesAreCaseInsensitive() throws SQLException {
501501
}
502502

503503
@Test // DATAJDBC-341
504-
public void immutableEmbeddedWithAllColumnsMissingShouldBeNull() throws SQLException {
504+
void immutableEmbeddedWithAllColumnsMissingShouldBeNull() throws SQLException {
505505

506506
ResultSet rs = mockResultSet(asList("ID"), //
507507
ID_FOR_ENTITY_NOT_REFERENCING_MAP);
@@ -517,7 +517,7 @@ public void immutableEmbeddedWithAllColumnsMissingShouldBeNull() throws SQLExcep
517517
}
518518

519519
@Test // DATAJDBC-341
520-
public void immutableEmbeddedWithSomeColumnsMissingShouldNotBeEmpty() throws SQLException {
520+
void immutableEmbeddedWithSomeColumnsMissingShouldNotBeEmpty() throws SQLException {
521521

522522
ResultSet rs = mockResultSet(asList("ID", "VALUE"), //
523523
ID_FOR_ENTITY_NOT_REFERENCING_MAP, "some value");
@@ -529,7 +529,7 @@ public void immutableEmbeddedWithSomeColumnsMissingShouldNotBeEmpty() throws SQL
529529
}
530530

531531
@Test // DATAJDBC-341
532-
public void immutableEmbeddedWithSomeColumnsMissingAndSomeNullShouldBeNull() throws SQLException {
532+
void immutableEmbeddedWithSomeColumnsMissingAndSomeNullShouldBeNull() throws SQLException {
533533

534534
ResultSet rs = mockResultSet(asList("ID", "VALUE"), //
535535
ID_FOR_ENTITY_NOT_REFERENCING_MAP, null);
@@ -545,7 +545,7 @@ public void immutableEmbeddedWithSomeColumnsMissingAndSomeNullShouldBeNull() thr
545545
}
546546

547547
@Test // DATAJDBC-341
548-
public void embeddedShouldBeNullWhenAllFieldsAreMissing() throws SQLException {
548+
void embeddedShouldBeNullWhenAllFieldsAreMissing() throws SQLException {
549549

550550
ResultSet rs = mockResultSet(asList("ID", "NAME"), //
551551
ID_FOR_ENTITY_NOT_REFERENCING_MAP, "alpha");
@@ -560,7 +560,7 @@ public void embeddedShouldBeNullWhenAllFieldsAreMissing() throws SQLException {
560560
}
561561

562562
@Test // DATAJDBC-341
563-
public void missingColumnsInEmbeddedShouldBeUnset() throws SQLException {
563+
void missingColumnsInEmbeddedShouldBeUnset() throws SQLException {
564564

565565
ResultSet rs = mockResultSet(asList("ID", "NAME", "PREFIX_ID"), //
566566
ID_FOR_ENTITY_NOT_REFERENCING_MAP, "alpha", 24);
@@ -575,7 +575,7 @@ public void missingColumnsInEmbeddedShouldBeUnset() throws SQLException {
575575
}
576576

577577
@Test // DATAJDBC-341
578-
public void primitiveEmbeddedShouldBeNullWhenAllColumnsAreMissing() throws SQLException {
578+
void primitiveEmbeddedShouldBeNullWhenAllColumnsAreMissing() throws SQLException {
579579

580580
ResultSet rs = mockResultSet(asList("ID"), //
581581
ID_FOR_ENTITY_NOT_REFERENCING_MAP);
@@ -591,7 +591,7 @@ public void primitiveEmbeddedShouldBeNullWhenAllColumnsAreMissing() throws SQLEx
591591
}
592592

593593
@Test // DATAJDBC-341
594-
public void oneToOneWithMissingColumnResultsInNullProperty() throws SQLException {
594+
void oneToOneWithMissingColumnResultsInNullProperty() throws SQLException {
595595

596596
ResultSet rs = mockResultSet(asList("ID", "NAME", "CHILD_ID"), //
597597
ID_FOR_ENTITY_NOT_REFERENCING_MAP, "alpha", 24L);
@@ -606,7 +606,7 @@ public void oneToOneWithMissingColumnResultsInNullProperty() throws SQLException
606606
}
607607

608608
@Test // DATAJDBC-341
609-
public void oneToOneWithMissingIdColumnResultsInNullProperty() throws SQLException {
609+
void oneToOneWithMissingIdColumnResultsInNullProperty() throws SQLException {
610610

611611
ResultSet rs = mockResultSet(asList("ID", "NAME", "CHILD_NAME"), //
612612
ID_FOR_ENTITY_NOT_REFERENCING_MAP, "alpha", "Alfred");
@@ -618,7 +618,7 @@ public void oneToOneWithMissingIdColumnResultsInNullProperty() throws SQLExcepti
618618
}
619619

620620
@Test // DATAJDBC-341
621-
public void immutableOneToOneWithIdMissingColumnResultsInNullReference() throws SQLException {
621+
void immutableOneToOneWithIdMissingColumnResultsInNullReference() throws SQLException {
622622

623623
ResultSet rs = mockResultSet(asList("ID", "NAME", "CHILD_NAME"), //
624624
ID_FOR_ENTITY_NOT_REFERENCING_MAP, "alpha", "Alfred");
@@ -632,7 +632,7 @@ public void immutableOneToOneWithIdMissingColumnResultsInNullReference() throws
632632
}
633633

634634
@Test // DATAJDBC-508
635-
public void materializesObjectWithAtValue() throws SQLException {
635+
void materializesObjectWithAtValue() throws SQLException {
636636

637637
ResultSet rs = mockResultSet(asList("ID", "FIRST_NAME"), //
638638
123L, "Hello World");
@@ -939,7 +939,7 @@ private static class ResultSetAnswer implements Answer<Object> {
939939
private final List<Map<String, Object>> values;
940940
private int index = -1;
941941

942-
public ResultSetAnswer(List<String> names, List<Map<String, Object>> values) {
942+
ResultSetAnswer(List<String> names, List<Map<String, Object>> values) {
943943

944944
this.names = names;
945945
this.values = values;

‎spring-data-relational/src/main/java/org/springframework/data/relational/core/conversion/BasicRelationalConverter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ private Object getPotentiallyConvertedSimpleWrite(Object value) {
218218
@Nullable
219219
@SuppressWarnings({ "rawtypes", "unchecked" })
220220
private Object getPotentiallyConvertedSimpleRead(Object value, TypeInformation<?> type) {
221+
221222
Class<?> target = type.getType();
222223
if (ClassUtils.isAssignableValue(target, value)) {
223224
return value;

‎spring-data-relational/src/test/java/org/springframework/data/relational/core/conversion/BasicRelationalConverterUnitTests.java

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717

1818
import static org.assertj.core.api.Assertions.*;
1919

20+
import lombok.Data;
21+
import lombok.Value;
22+
2023
import java.util.Arrays;
2124
import java.util.List;
2225
import java.util.Set;
@@ -33,16 +36,13 @@
3336
import org.springframework.data.util.ClassTypeInformation;
3437
import org.springframework.data.util.TypeInformation;
3538

36-
import lombok.Data;
37-
import lombok.Value;
38-
3939
/**
4040
* Unit tests for {@link BasicRelationalConverter}.
4141
*
4242
* @author Mark Paluch
4343
* @author Chirag Tailor
4444
*/
45-
public class BasicRelationalConverterUnitTests {
45+
class BasicRelationalConverterUnitTests {
4646

4747
RelationalMappingContext context = new RelationalMappingContext();
4848
RelationalConverter converter;
@@ -61,7 +61,7 @@ public void before() throws Exception {
6161

6262
@Test // DATAJDBC-235
6363
@SuppressWarnings("unchecked")
64-
public void shouldUseConvertingPropertyAccessor() {
64+
void shouldUseConvertingPropertyAccessor() {
6565

6666
RelationalPersistentEntity<MyEntity> entity = (RelationalPersistentEntity) context
6767
.getRequiredPersistentEntity(MyEntity.class);
@@ -76,15 +76,15 @@ public void shouldUseConvertingPropertyAccessor() {
7676
}
7777

7878
@Test // DATAJDBC-235
79-
public void shouldConvertEnumToString() {
79+
void shouldConvertEnumToString() {
8080

8181
Object result = converter.writeValue(MyEnum.ON, ClassTypeInformation.from(String.class));
8282

8383
assertThat(result).isEqualTo("ON");
8484
}
8585

8686
@Test // DATAJDBC-235
87-
public void shouldConvertStringToEnum() {
87+
void shouldConvertStringToEnum() {
8888

8989
Object result = converter.readValue("OFF", ClassTypeInformation.from(MyEnum.class));
9090

@@ -93,15 +93,17 @@ public void shouldConvertStringToEnum() {
9393

9494
@Test // GH-1046
9595
void shouldConvertArrayElementsToTargetElementType() throws NoSuchMethodException {
96-
TypeInformation<Object> typeInformation = ClassTypeInformation.fromReturnTypeOf(EntityWithArray.class.getMethod("getFloats"));
97-
Double[] value = {1.2d, 1.3d, 1.4d};
96+
97+
TypeInformation<Object> typeInformation = ClassTypeInformation
98+
.fromReturnTypeOf(EntityWithArray.class.getMethod("getFloats"));
99+
Double[] value = { 1.2d, 1.3d, 1.4d };
98100
Object result = converter.readValue(value, typeInformation);
99101
assertThat(result).isEqualTo(Arrays.asList(1.2f, 1.3f, 1.4f));
100102
}
101103

102104
@Test // DATAJDBC-235
103105
@SuppressWarnings("unchecked")
104-
public void shouldCreateInstance() {
106+
void shouldCreateInstance() {
105107

106108
RelationalPersistentEntity<WithConstructorCreation> entity = (RelationalPersistentEntity) context
107109
.getRequiredPersistentEntity(WithConstructorCreation.class);
@@ -112,15 +114,15 @@ public void shouldCreateInstance() {
112114
}
113115

114116
@Test // DATAJDBC-516
115-
public void shouldConsiderWriteConverter() {
117+
void shouldConsiderWriteConverter() {
116118

117119
Object result = converter.writeValue(new MyValue("hello-world"), ClassTypeInformation.from(MyValue.class));
118120

119121
assertThat(result).isEqualTo("hello-world");
120122
}
121123

122124
@Test // DATAJDBC-516
123-
public void shouldConsiderReadConverter() {
125+
void shouldConsiderReadConverter() {
124126

125127
Object result = converter.readValue("hello-world", ClassTypeInformation.from(MyValue.class));
126128

0 commit comments

Comments
 (0)
Please sign in to comment.