15
15
*/
16
16
package org .apache .ibatis .submitted .cursor_simple ;
17
17
18
- import static org .junit .Assert .assertFalse ;
19
- import static org .junit .Assert .assertNull ;
20
- import static org .junit .Assert .assertTrue ;
21
- import static org .junit .jupiter .api .Assertions .assertEquals ;
22
-
23
18
import org .apache .ibatis .BaseDataTest ;
24
19
import org .apache .ibatis .cursor .Cursor ;
25
20
import org .apache .ibatis .io .Resources ;
@@ -399,45 +394,45 @@ void shouldNullItemNotStopIteration() {
399
394
Cursor <User > cursor = mapper .getNullUsers (new RowBounds ());
400
395
Iterator <User > iterator = cursor .iterator ();
401
396
402
- assertFalse (cursor .isOpen ());
397
+ Assertions . assertFalse (cursor .isOpen ());
403
398
404
399
// Cursor is just created, current index is -1
405
- assertEquals (-1 , cursor .getCurrentIndex ());
400
+ Assertions . assertEquals (-1 , cursor .getCurrentIndex ());
406
401
407
402
// Check if hasNext, fetching is started
408
- assertTrue (iterator .hasNext ());
403
+ Assertions . assertTrue (iterator .hasNext ());
409
404
// Re-invoking hasNext() should not fetch the next row
410
- assertTrue (iterator .hasNext ());
411
- assertTrue (cursor .isOpen ());
412
- assertFalse (cursor .isConsumed ());
405
+ Assertions . assertTrue (iterator .hasNext ());
406
+ Assertions . assertTrue (cursor .isOpen ());
407
+ Assertions . assertFalse (cursor .isConsumed ());
413
408
414
409
// next() has not been called, index is still -1
415
- assertEquals (-1 , cursor .getCurrentIndex ());
410
+ Assertions . assertEquals (-1 , cursor .getCurrentIndex ());
416
411
417
412
User user ;
418
413
user = iterator .next ();
419
- assertNull (user );
420
- assertEquals (0 , cursor .getCurrentIndex ());
414
+ Assertions . assertNull (user );
415
+ Assertions . assertEquals (0 , cursor .getCurrentIndex ());
421
416
422
- assertTrue (iterator .hasNext ());
417
+ Assertions . assertTrue (iterator .hasNext ());
423
418
user = iterator .next ();
424
- assertEquals ("Kate" , user .getName ());
425
- assertEquals (1 , cursor .getCurrentIndex ());
419
+ Assertions . assertEquals ("Kate" , user .getName ());
420
+ Assertions . assertEquals (1 , cursor .getCurrentIndex ());
426
421
427
- assertTrue (iterator .hasNext ());
422
+ Assertions . assertTrue (iterator .hasNext ());
428
423
user = iterator .next ();
429
- assertNull (user );
430
- assertEquals (2 , cursor .getCurrentIndex ());
424
+ Assertions . assertNull (user );
425
+ Assertions . assertEquals (2 , cursor .getCurrentIndex ());
431
426
432
- assertTrue (iterator .hasNext ());
427
+ Assertions . assertTrue (iterator .hasNext ());
433
428
user = iterator .next ();
434
- assertNull (user );
435
- assertEquals (3 , cursor .getCurrentIndex ());
429
+ Assertions . assertNull (user );
430
+ Assertions . assertEquals (3 , cursor .getCurrentIndex ());
436
431
437
432
// Check no more elements
438
- assertFalse (iterator .hasNext ());
439
- assertFalse (cursor .isOpen ());
440
- assertTrue (cursor .isConsumed ());
433
+ Assertions . assertFalse (iterator .hasNext ());
434
+ Assertions . assertFalse (cursor .isOpen ());
435
+ Assertions . assertTrue (cursor .isConsumed ());
441
436
}
442
437
}
443
438
@@ -448,29 +443,29 @@ void shouldRowBoundsCountNullItem() {
448
443
Cursor <User > cursor = mapper .getNullUsers (new RowBounds (1 , 2 ));
449
444
Iterator <User > iterator = cursor .iterator ();
450
445
451
- assertFalse (cursor .isOpen ());
446
+ Assertions . assertFalse (cursor .isOpen ());
452
447
453
448
// Check if hasNext, fetching is started
454
- assertTrue (iterator .hasNext ());
449
+ Assertions . assertTrue (iterator .hasNext ());
455
450
// Re-invoking hasNext() should not fetch the next row
456
- assertTrue (iterator .hasNext ());
457
- assertTrue (cursor .isOpen ());
458
- assertFalse (cursor .isConsumed ());
451
+ Assertions . assertTrue (iterator .hasNext ());
452
+ Assertions . assertTrue (cursor .isOpen ());
453
+ Assertions . assertFalse (cursor .isConsumed ());
459
454
460
455
User user ;
461
456
user = iterator .next ();
462
- assertEquals ("Kate" , user .getName ());
463
- assertEquals (1 , cursor .getCurrentIndex ());
457
+ Assertions . assertEquals ("Kate" , user .getName ());
458
+ Assertions . assertEquals (1 , cursor .getCurrentIndex ());
464
459
465
- assertTrue (iterator .hasNext ());
460
+ Assertions . assertTrue (iterator .hasNext ());
466
461
user = iterator .next ();
467
- assertNull (user );
468
- assertEquals (2 , cursor .getCurrentIndex ());
462
+ Assertions . assertNull (user );
463
+ Assertions . assertEquals (2 , cursor .getCurrentIndex ());
469
464
470
465
// Check no more elements
471
- assertFalse (iterator .hasNext ());
472
- assertFalse (cursor .isOpen ());
473
- assertTrue (cursor .isConsumed ());
466
+ Assertions . assertFalse (iterator .hasNext ());
467
+ Assertions . assertFalse (cursor .isOpen ());
468
+ Assertions . assertTrue (cursor .isConsumed ());
474
469
}
475
470
}
476
471
}
0 commit comments