@@ -293,7 +293,7 @@ class SeriesServiceImplTest extends Specification {
293
293
@SuppressWarnings ([' ClosureAsLastMethodParameter' , ' UnnecessaryReturnKeyword' ])
294
294
def " add() should assign created/updated at/by to current date/user" () {
295
295
given :
296
- Integer expectedUserId = 789
296
+ Integer expectedUserId = Random . userId()
297
297
when :
298
298
service. add(form, expectedUserId, false )
299
299
then :
@@ -467,14 +467,14 @@ class SeriesServiceImplTest extends Specification {
467
467
468
468
def " addImageToSeries() should throw exception when dto is null" () {
469
469
when :
470
- service. addImageToSeries(null , Random . id(), 222 )
470
+ service. addImageToSeries(null , Random . id(), Random . userId() )
471
471
then :
472
472
thrown IllegalArgumentException
473
473
}
474
474
475
475
def " addImageToSeries() should throw exception when series id is null" () {
476
476
when :
477
- service. addImageToSeries(imageForm, null , 222 )
477
+ service. addImageToSeries(imageForm, null , Random . userId() )
478
478
then :
479
479
thrown IllegalArgumentException
480
480
}
@@ -490,7 +490,7 @@ class SeriesServiceImplTest extends Specification {
490
490
def " addImageToSeries() should mark series as modified" () {
491
491
given :
492
492
Integer expectedSeriesId = Random . id()
493
- Integer expectedUserId = 321
493
+ Integer expectedUserId = Random . userId()
494
494
when :
495
495
service. addImageToSeries(imageForm, expectedSeriesId, expectedUserId)
496
496
then :
@@ -508,15 +508,15 @@ class SeriesServiceImplTest extends Specification {
508
508
given :
509
509
imageForm. setImage(multipartFile)
510
510
when :
511
- service. addImageToSeries(imageForm, Random . id(), 222 )
511
+ service. addImageToSeries(imageForm, Random . id(), Random . userId() )
512
512
then :
513
513
1 * imageService. save(multipartFile) >> TestObjects . createImageInfoDto()
514
514
}
515
515
516
516
def " addImageToSeries() should add image to series" () {
517
517
given :
518
518
Integer expectedSeriesId = Random . id()
519
- Integer expectedUserId = 321
519
+ Integer expectedUserId = Random . userId()
520
520
Integer expectedImageId = Random . id()
521
521
when :
522
522
service. addImageToSeries(imageForm, expectedSeriesId, expectedUserId)
@@ -532,7 +532,7 @@ class SeriesServiceImplTest extends Specification {
532
532
and :
533
533
imageService. addToSeries(_ as Integer , _ as Integer ) >> { throw new IllegalStateException () }
534
534
when :
535
- service. addImageToSeries(imageForm, Random . id(), 222 )
535
+ service. addImageToSeries(imageForm, Random . id(), Random . userId() )
536
536
then :
537
537
imageService. save(_) >> expectedImageInfo
538
538
and :
0 commit comments