1717
1818import static examples .simple .SimpleTableDynamicSqlSupport .*;
1919import static org .assertj .core .api .Assertions .assertThat ;
20+ import static org .junit .jupiter .api .Assertions .assertAll ;
2021import static org .mybatis .dynamic .sql .SqlBuilder .*;
2122
2223import java .io .InputStream ;
3536import org .apache .ibatis .session .SqlSessionFactory ;
3637import org .apache .ibatis .session .SqlSessionFactoryBuilder ;
3738import org .apache .ibatis .transaction .jdbc .JdbcTransactionFactory ;
38- import org .assertj .core .api .SoftAssertions ;
3939import org .junit .jupiter .api .BeforeEach ;
4040import org .junit .jupiter .api .Test ;
4141import org .junit .platform .runner .JUnitPlatform ;
@@ -141,11 +141,11 @@ public void testSelectByExampleWithTypeHandler() {
141141 .build ()
142142 .execute ();
143143
144- SoftAssertions . assertSoftly ( softly -> {
145- softly . assertThat (rows .size ()).isEqualTo (2 );
146- softly . assertThat (rows .get (0 ).getId ()).isEqualTo (3 );
147- softly . assertThat (rows .get (1 ).getId ()).isEqualTo (6 );
148- } );
144+ assertAll (
145+ () -> assertThat (rows .size ()).isEqualTo (2 ),
146+ () -> assertThat (rows .get (0 ).getId ()).isEqualTo (3 ),
147+ () -> assertThat (rows .get (1 ).getId ()).isEqualTo (6 )
148+ );
149149 }
150150 }
151151
@@ -159,9 +159,11 @@ public void testFirstNameIn() {
159159 .build ()
160160 .execute ();
161161
162- assertThat (rows .size ()).isEqualTo (2 );
163- assertThat (rows .get (0 ).getLastName ().getName ()).isEqualTo ("Flintstone" );
164- assertThat (rows .get (1 ).getLastName ().getName ()).isEqualTo ("Rubble" );
162+ assertAll (
163+ () -> assertThat (rows .size ()).isEqualTo (2 ),
164+ () -> assertThat (rows .get (0 ).getLastName ().getName ()).isEqualTo ("Flintstone" ),
165+ () -> assertThat (rows .get (1 ).getLastName ().getName ()).isEqualTo ("Rubble" )
166+ );
165167 }
166168 }
167169
@@ -232,17 +234,15 @@ public void testUpdateByPrimaryKey() {
232234 record .setEmployed (true );
233235 record .setOccupation ("Developer" );
234236
235- SoftAssertions .assertSoftly (softly -> {
236- int rows = mapper .insert (record );
237- softly .assertThat (rows ).isEqualTo (1 );
237+ int rows = mapper .insert (record );
238+ assertThat (rows ).isEqualTo (1 );
238239
239- record .setOccupation ("Programmer" );
240- rows = mapper .updateByPrimaryKey (record );
241- softly . assertThat (rows ).isEqualTo (1 );
240+ record .setOccupation ("Programmer" );
241+ rows = mapper .updateByPrimaryKey (record );
242+ assertThat (rows ).isEqualTo (1 );
242243
243- SimpleTableRecord newRecord = mapper .selectByPrimaryKey (100 );
244- softly .assertThat (newRecord .getOccupation ()).isEqualTo ("Programmer" );
245- });
244+ SimpleTableRecord newRecord = mapper .selectByPrimaryKey (100 );
245+ assertThat (newRecord .getOccupation ()).isEqualTo ("Programmer" );
246246 }
247247 }
248248
@@ -258,20 +258,18 @@ public void testUpdateByPrimaryKeySelective() {
258258 record .setEmployed (true );
259259 record .setOccupation ("Developer" );
260260
261- SoftAssertions .assertSoftly (softly -> {
262- int rows = mapper .insert (record );
263- softly .assertThat (rows ).isEqualTo (1 );
261+ int rows = mapper .insert (record );
262+ assertThat (rows ).isEqualTo (1 );
264263
265- SimpleTableRecord updateRecord = new SimpleTableRecord ();
266- updateRecord .setId (100 );
267- updateRecord .setOccupation ("Programmer" );
268- rows = mapper .updateByPrimaryKeySelective (updateRecord );
269- softly . assertThat (rows ).isEqualTo (1 );
264+ SimpleTableRecord updateRecord = new SimpleTableRecord ();
265+ updateRecord .setId (100 );
266+ updateRecord .setOccupation ("Programmer" );
267+ rows = mapper .updateByPrimaryKeySelective (updateRecord );
268+ assertThat (rows ).isEqualTo (1 );
270269
271- SimpleTableRecord newRecord = mapper .selectByPrimaryKey (100 );
272- softly .assertThat (newRecord .getOccupation ()).isEqualTo ("Programmer" );
273- softly .assertThat (newRecord .getFirstName ()).isEqualTo ("Joe" );
274- });
270+ SimpleTableRecord newRecord = mapper .selectByPrimaryKey (100 );
271+ assertThat (newRecord .getOccupation ()).isEqualTo ("Programmer" );
272+ assertThat (newRecord .getFirstName ()).isEqualTo ("Joe" );
275273 }
276274 }
277275
@@ -287,25 +285,25 @@ public void testUpdateWithNulls() {
287285 record .setEmployed (true );
288286 record .setOccupation ("Developer" );
289287
290- SoftAssertions .assertSoftly (softly -> {
291- int rows = mapper .insert (record );
292- softly .assertThat (rows ).isEqualTo (1 );
288+ int rows = mapper .insert (record );
289+ assertThat (rows ).isEqualTo (1 );
293290
294- UpdateStatementProvider updateStatement = update (simpleTable )
295- .set (occupation ).equalToNull ()
296- .set (employed ).equalTo (false )
297- .where (id , isEqualTo (100 ))
298- .build ()
299- .render (RenderingStrategy .MYBATIS3 );
291+ UpdateStatementProvider updateStatement = update (simpleTable )
292+ .set (occupation ).equalToNull ()
293+ .set (employed ).equalTo (false )
294+ .where (id , isEqualTo (100 ))
295+ .build ()
296+ .render (RenderingStrategy .MYBATIS3 );
300297
301- rows = mapper .update (updateStatement );
302- softly . assertThat (rows ).isEqualTo (1 );
298+ rows = mapper .update (updateStatement );
299+ assertThat (rows ).isEqualTo (1 );
303300
304- SimpleTableRecord newRecord = mapper .selectByPrimaryKey (100 );
305- softly .assertThat (newRecord .getOccupation ()).isNull ();
306- softly .assertThat (newRecord .getEmployed ()).isEqualTo (false );
307- softly .assertThat (newRecord .getFirstName ()).isEqualTo ("Joe" );
308- });
301+ SimpleTableRecord newRecord = mapper .selectByPrimaryKey (100 );
302+ assertAll (
303+ () -> assertThat (newRecord .getOccupation ()).isNull (),
304+ () -> assertThat (newRecord .getEmployed ()).isEqualTo (false ),
305+ () -> assertThat (newRecord .getFirstName ()).isEqualTo ("Joe" )
306+ );
309307 }
310308 }
311309
@@ -321,22 +319,20 @@ public void testUpdateByExample() {
321319 record .setEmployed (true );
322320 record .setOccupation ("Developer" );
323321
324- SoftAssertions .assertSoftly (softly -> {
325- int rows = mapper .insert (record );
326- softly .assertThat (rows ).isEqualTo (1 );
322+ int rows = mapper .insert (record );
323+ assertThat (rows ).isEqualTo (1 );
327324
328- record .setOccupation ("Programmer" );
329- rows = mapper .updateByExample (record )
330- .where (id , isEqualTo (100 ))
331- .and (firstName , isEqualTo ("Joe" ))
332- .build ()
333- .execute ();
325+ record .setOccupation ("Programmer" );
326+ rows = mapper .updateByExample (record )
327+ .where (id , isEqualTo (100 ))
328+ .and (firstName , isEqualTo ("Joe" ))
329+ .build ()
330+ .execute ();
334331
335- softly . assertThat (rows ).isEqualTo (1 );
332+ assertThat (rows ).isEqualTo (1 );
336333
337- SimpleTableRecord newRecord = mapper .selectByPrimaryKey (100 );
338- softly .assertThat (newRecord .getOccupation ()).isEqualTo ("Programmer" );
339- });
334+ SimpleTableRecord newRecord = mapper .selectByPrimaryKey (100 );
335+ assertThat (newRecord .getOccupation ()).isEqualTo ("Programmer" );
340336 }
341337 }
342338
0 commit comments