6161class MappingJdbcConverterUnitTests {
6262
6363 private static final UUID UUID = java .util .UUID .fromString ("87a48aa8-a071-705e-54a9-e52fe3a012f1" );
64- private static final byte [] BYTES_REPRESENTING_UUID = { -121 , -92 , -118 , -88 , -96 , 113 , 112 , 94 , 84 , -87 , -27 , 47 ,
64+ private static final byte [] BYTES_REPRESENTING_UUID = {-121 , -92 , -118 , -88 , -96 , 113 , 112 , 94 , 84 , -87 , -27 , 47 ,
6565 -29 ,
66- -96 , 18 , -15 };
66+ -96 , 18 , -15 };
6767
6868 private JdbcMappingContext context = new JdbcMappingContext ();
6969 private StubbedJdbcTypeFactory typeFactory = new StubbedJdbcTypeFactory ();
@@ -79,31 +79,32 @@ class MappingJdbcConverterUnitTests {
7979 context .setSimpleTypeHolder (converter .getConversions ().getSimpleTypeHolder ());
8080 }
8181
82- @ Test // DATAJDBC-104, DATAJDBC-1384
82+ @ Test
83+ // DATAJDBC-104, DATAJDBC-1384
8384 void testTargetTypesForPropertyType () {
8485
8586 RelationalPersistentEntity <?> entity = context .getRequiredPersistentEntity (DummyEntity .class );
8687
87- SoftAssertions softly = new SoftAssertions ();
88-
89- checkTargetType (softly , entity , "someEnum" , String .class );
90- checkTargetType (softly , entity , "localDateTime" , LocalDateTime .class );
91- checkTargetType (softly , entity , "localDate" , Timestamp .class );
92- checkTargetType (softly , entity , "localTime" , Timestamp .class );
93- checkTargetType (softly , entity , "zonedDateTime" , String .class );
94- checkTargetType (softly , entity , "offsetDateTime" , OffsetDateTime .class );
95- checkTargetType (softly , entity , "instant" , Timestamp .class );
96- checkTargetType (softly , entity , "date" , Date .class );
97- checkTargetType (softly , entity , "timestamp" , Timestamp .class );
98- checkTargetType (softly , entity , "uuid" , UUID .class );
99- checkTargetType (softly , entity , "reference" , Long .class );
100- checkTargetType (softly , entity , "enumIdReference" , String .class );
101- checkTargetType (softly , entity , "customIdReference" , Long .class );
102-
103- softly .assertAll ();
88+ SoftAssertions .assertSoftly (softly -> {
89+
90+ checkTargetType (softly , entity , "someEnum" , String .class );
91+ checkTargetType (softly , entity , "localDateTime" , LocalDateTime .class );
92+ checkTargetType (softly , entity , "localDate" , Timestamp .class );
93+ checkTargetType (softly , entity , "localTime" , Timestamp .class );
94+ checkTargetType (softly , entity , "zonedDateTime" , String .class );
95+ checkTargetType (softly , entity , "offsetDateTime" , OffsetDateTime .class );
96+ checkTargetType (softly , entity , "instant" , Timestamp .class );
97+ checkTargetType (softly , entity , "date" , Date .class );
98+ checkTargetType (softly , entity , "timestamp" , Timestamp .class );
99+ checkTargetType (softly , entity , "uuid" , UUID .class );
100+ checkTargetType (softly , entity , "reference" , Long .class );
101+ checkTargetType (softly , entity , "enumIdReference" , String .class );
102+ checkTargetType (softly , entity , "customIdReference" , Long .class );
103+ });
104104 }
105105
106- @ Test // DATAJDBC-259
106+ @ Test
107+ // DATAJDBC-259
107108 void classificationOfCollectionLikeProperties () {
108109
109110 RelationalPersistentEntity <?> entity = context .getRequiredPersistentEntity (DummyEntity .class );
@@ -119,22 +120,24 @@ void classificationOfCollectionLikeProperties() {
119120 softly .assertAll ();
120121 }
121122
122- @ Test // DATAJDBC-221
123+ @ Test
124+ // DATAJDBC-221
123125 void referencesAreNotEntitiesAndGetStoredAsTheirId () {
124126
125127 RelationalPersistentEntity <?> entity = context .getRequiredPersistentEntity (DummyEntity .class );
126128
127- SoftAssertions softly = new SoftAssertions ();
128129
129130 RelationalPersistentProperty reference = entity .getRequiredPersistentProperty ("reference" );
130131
131- softly .assertThat (reference .isEntity ()).isFalse ();
132- softly .assertThat (converter .getColumnType (reference )).isEqualTo (Long .class );
132+ SoftAssertions .assertSoftly (softly -> {
133133
134- softly .assertAll ();
134+ softly .assertThat (reference .isEntity ()).isFalse ();
135+ softly .assertThat (converter .getColumnType (reference )).isEqualTo (Long .class );
136+ });
135137 }
136138
137- @ Test // DATAJDBC-637
139+ @ Test
140+ // DATAJDBC-637
138141 void conversionOfDateLikeValueAndBackYieldsOriginalValue () {
139142
140143 RelationalPersistentEntity <?> persistentEntity = context .getRequiredPersistentEntity (DummyEntity .class );
@@ -150,17 +153,19 @@ void conversionOfDateLikeValueAndBackYieldsOriginalValue() {
150153
151154 }
152155
153- @ Test // GH-945
156+ @ Test
157+ // GH-945
154158 void conversionOfPrimitiveArrays () {
155159
156- int [] ints = { 1 , 2 , 3 , 4 , 5 };
160+ int [] ints = {1 , 2 , 3 , 4 , 5 };
157161 JdbcValue converted = converter .writeJdbcValue (ints , ints .getClass (), JdbcUtil .targetSqlTypeFor (ints .getClass ()));
158162
159163 assertThat (converted .getValue ()).isInstanceOf (Array .class );
160164 assertThat (typeFactory .arraySource ).containsExactly (1 , 2 , 3 , 4 , 5 );
161165 }
162166
163- @ Test // GH-1684
167+ @ Test
168+ // GH-1684
164169 void accessesCorrectValuesForOneToOneRelationshipWithIdenticallyNamedIdProperties () {
165170
166171 RowDocument rowdocument = new RowDocument (Map .of ("ID" , "one" , "REFERENCED_ID" , 23 ));
@@ -170,7 +175,8 @@ void accessesCorrectValuesForOneToOneRelationshipWithIdenticallyNamedIdPropertie
170175 assertThat (result ).isEqualTo (new WithOneToOne ("one" , new Referenced (23L )));
171176 }
172177
173- @ Test // GH-1750
178+ @ Test
179+ // GH-1750
174180 void readByteArrayToNestedUuidWithCustomConverter () {
175181
176182 JdbcMappingContext context = new JdbcMappingContext ();
@@ -194,7 +200,7 @@ void readByteArrayToNestedUuidWithCustomConverter() {
194200 }
195201
196202 private static void checkReadConversion (SoftAssertions softly , MappingJdbcConverter converter , String propertyName ,
197- Object expected ) {
203+ Object expected ) {
198204
199205 RelationalPersistentProperty property = converter .getMappingContext ().getRequiredPersistentEntity (DummyEntity .class )
200206 .getRequiredPersistentProperty (propertyName );
@@ -205,7 +211,7 @@ private static void checkReadConversion(SoftAssertions softly, MappingJdbcConver
205211 }
206212
207213 private void checkConversionToTimestampAndBack (SoftAssertions softly , RelationalPersistentEntity <?> persistentEntity ,
208- String propertyName , Object value ) {
214+ String propertyName , Object value ) {
209215
210216 RelationalPersistentProperty property = persistentEntity .getRequiredPersistentProperty (propertyName );
211217
@@ -216,7 +222,7 @@ private void checkConversionToTimestampAndBack(SoftAssertions softly, Relational
216222 }
217223
218224 private void checkTargetType (SoftAssertions softly , RelationalPersistentEntity <?> persistentEntity ,
219- String propertyName , Class <?> expected ) {
225+ String propertyName , Class <?> expected ) {
220226
221227 RelationalPersistentProperty property = persistentEntity .getRequiredPersistentProperty (propertyName );
222228
@@ -240,100 +246,12 @@ private record DummyEntity(
240246 AggregateReference <ReferencedByUuid , UUID > uuidRef ,
241247 Optional <UUID > optionalUuid ,
242248
243- // DATAJDBC-259
244- private final List <String > listOfString ;
245- private final String [] arrayOfString ;
246- private final List <OtherEntity > listOfEntity ;
247- private final OtherEntity [] arrayOfEntity ;
248-
249- private DummyEntity (Long id , SomeEnum someEnum , LocalDateTime localDateTime , LocalDate localDate ,
250- LocalTime localTime , ZonedDateTime zonedDateTime , OffsetDateTime offsetDateTime , Instant instant , Date date ,
251- Timestamp timestamp , AggregateReference <DummyEntity , Long > reference , UUID uuid ,
252- AggregateReference <ReferencedByUuid , UUID > uuidRef , Optional <java .util .UUID > optionalUUID , List <String > listOfString , String [] arrayOfString ,
253- List <OtherEntity > listOfEntity , OtherEntity [] arrayOfEntity ) {
254- this .id = id ;
255- this .someEnum = someEnum ;
256- this .localDateTime = localDateTime ;
257- this .localDate = localDate ;
258- this .localTime = localTime ;
259- this .zonedDateTime = zonedDateTime ;
260- this .offsetDateTime = offsetDateTime ;
261- this .instant = instant ;
262- this .date = date ;
263- this .timestamp = timestamp ;
264- this .reference = reference ;
265- this .uuid = uuid ;
266- this .uuidRef = uuidRef ;
267- this .optionalUuid = optionalUUID ;
268- this .listOfString = listOfString ;
269- this .arrayOfString = arrayOfString ;
270- this .listOfEntity = listOfEntity ;
271- this .arrayOfEntity = arrayOfEntity ;
272- }
273-
274- public Long getId () {
275- return this .id ;
276- }
277-
278- public SomeEnum getSomeEnum () {
279- return this .someEnum ;
280- }
281-
282- public LocalDateTime getLocalDateTime () {
283- return this .localDateTime ;
284- }
285-
286- public LocalDate getLocalDate () {
287- return this .localDate ;
288- }
289-
290- public LocalTime getLocalTime () {
291- return this .localTime ;
292- }
293-
294- public ZonedDateTime getZonedDateTime () {
295- return this .zonedDateTime ;
296- }
297-
298- public OffsetDateTime getOffsetDateTime () {
299- return this .offsetDateTime ;
300- }
301-
302- public Instant getInstant () {
303- return this .instant ;
304- }
305-
306- public Date getDate () {
307- return this .date ;
308- }
309-
310- public Timestamp getTimestamp () {
311- return this .timestamp ;
312- }
313-
314- public AggregateReference <DummyEntity , Long > getReference () {
315- return this .reference ;
316- }
317-
318- public UUID getUuid () {
319- return this .uuid ;
320- }
321-
322- public List <String > getListOfString () {
323- return this .listOfString ;
324- }
325-
326- public String [] getArrayOfString () {
327- return this .arrayOfString ;
328- }
329-
330- public List <OtherEntity > getListOfEntity () {
331- return this .listOfEntity ;
332- }
333-
334- public OtherEntity [] getArrayOfEntity () {
335- return this .arrayOfEntity ;
336- }
249+ // DATAJDBC-259
250+ List <String > listOfString ,
251+ String [] arrayOfString ,
252+ List <OtherEntity > listOfEntity ,
253+ OtherEntity [] arrayOfEntity
254+ ) {
337255 }
338256
339257 @ SuppressWarnings ("unused" )
@@ -342,7 +260,8 @@ private enum SomeEnum {
342260 }
343261
344262 @ SuppressWarnings ("unused" )
345- private static class OtherEntity {}
263+ private static class OtherEntity {
264+ }
346265
347266 private static class EnumIdEntity {
348267 @ Id SomeEnum id ;
0 commit comments