@@ -90,7 +90,7 @@ class SeriesServiceImplTest extends Specification {
90
90
91
91
def " add() should throw exception if dto is null" () {
92
92
when :
93
- service. add(null , Random . userId(), false )
93
+ service. add(null , Random . userId(), bool() )
94
94
then :
95
95
thrown IllegalArgumentException
96
96
}
@@ -99,7 +99,7 @@ class SeriesServiceImplTest extends Specification {
99
99
given :
100
100
form. setQuantity(null )
101
101
when :
102
- service. add(form, Random . userId(), false )
102
+ service. add(form, Random . userId(), bool() )
103
103
then :
104
104
thrown IllegalArgumentException
105
105
}
@@ -108,7 +108,7 @@ class SeriesServiceImplTest extends Specification {
108
108
given :
109
109
form. setPerforated(null )
110
110
when :
111
- service. add(form, Random . userId(), false )
111
+ service. add(form, Random . userId(), bool() )
112
112
then :
113
113
thrown IllegalArgumentException
114
114
}
@@ -117,7 +117,7 @@ class SeriesServiceImplTest extends Specification {
117
117
given :
118
118
form. setCategory(null )
119
119
when :
120
- service. add(form, Random . userId(), false )
120
+ service. add(form, Random . userId(), bool() )
121
121
then :
122
122
thrown IllegalArgumentException
123
123
}
@@ -126,14 +126,14 @@ class SeriesServiceImplTest extends Specification {
126
126
given :
127
127
form. setCategory(new LinkEntityDto (null , ' test' , ' Test' ))
128
128
when :
129
- service. add(form, Random . userId(), false )
129
+ service. add(form, Random . userId(), bool() )
130
130
then :
131
131
thrown IllegalArgumentException
132
132
}
133
133
134
134
def " add() should throw exception when user is null" () {
135
135
when :
136
- service. add(form, null , false )
136
+ service. add(form, null , bool() )
137
137
then :
138
138
thrown IllegalArgumentException
139
139
}
@@ -147,7 +147,7 @@ class SeriesServiceImplTest extends Specification {
147
147
and :
148
148
form. setCountry(country)
149
149
when :
150
- service. add(form, Random . userId(), false )
150
+ service. add(form, Random . userId(), bool() )
151
151
then :
152
152
1 * seriesDao. add({ AddSeriesDbDto series ->
153
153
assert series?. countryId == expectedCountryId
@@ -166,7 +166,7 @@ class SeriesServiceImplTest extends Specification {
166
166
form. setMonth(month)
167
167
form. setYear(year)
168
168
when :
169
- service. add(form, Random . userId(), false )
169
+ service. add(form, Random . userId(), bool() )
170
170
then :
171
171
1 * seriesDao. add({ AddSeriesDbDto series ->
172
172
assert series?. releaseDay == expectedDay
@@ -195,7 +195,7 @@ class SeriesServiceImplTest extends Specification {
195
195
and :
196
196
form. setCategory(category)
197
197
when :
198
- service. add(form, Random . userId(), false )
198
+ service. add(form, Random . userId(), bool() )
199
199
then :
200
200
1 * seriesDao. add({ AddSeriesDbDto series ->
201
201
assert series?. categoryId == expectedCategoryId
@@ -209,7 +209,7 @@ class SeriesServiceImplTest extends Specification {
209
209
Integer expectedQuantity = 3
210
210
form. setQuantity(expectedQuantity)
211
211
when :
212
- service. add(form, Random . userId(), false )
212
+ service. add(form, Random . userId(), bool() )
213
213
then :
214
214
1 * seriesDao. add({ AddSeriesDbDto series ->
215
215
assert series?. quantity == expectedQuantity
@@ -223,7 +223,7 @@ class SeriesServiceImplTest extends Specification {
223
223
Boolean expectedResult = true
224
224
form. setPerforated(expectedResult)
225
225
when :
226
- service. add(form, Random . userId(), false )
226
+ service. add(form, Random . userId(), bool() )
227
227
then :
228
228
1 * seriesDao. add({ AddSeriesDbDto series ->
229
229
assert series?. perforated == expectedResult
@@ -295,7 +295,7 @@ class SeriesServiceImplTest extends Specification {
295
295
given :
296
296
Integer expectedUserId = Random . userId()
297
297
when :
298
- service. add(form, expectedUserId, false )
298
+ service. add(form, expectedUserId, bool() )
299
299
then :
300
300
1 * seriesDao. add({ AddSeriesDbDto series ->
301
301
assert series?. createdBy == expectedUserId
@@ -310,7 +310,7 @@ class SeriesServiceImplTest extends Specification {
310
310
given :
311
311
Integer expected = Random . id()
312
312
when :
313
- Integer actual = service. add(form, Random . userId(), false )
313
+ Integer actual = service. add(form, Random . userId(), bool() )
314
314
then :
315
315
1 * seriesDao. add(_ as AddSeriesDbDto ) >> expected
316
316
and :
@@ -327,7 +327,7 @@ class SeriesServiceImplTest extends Specification {
327
327
and :
328
328
seriesDao. add(_ as AddSeriesDbDto ) >> expectedSeriesId
329
329
when :
330
- service. add(form, Random . userId(), false )
330
+ service. add(form, Random . userId(), bool() )
331
331
then :
332
332
1 * michelCatalogService. add(expectedNumbers)
333
333
and :
@@ -344,7 +344,7 @@ class SeriesServiceImplTest extends Specification {
344
344
and :
345
345
seriesDao. add(_ as AddSeriesDbDto ) >> expectedSeriesId
346
346
when :
347
- service. add(form, Random . userId(), false )
347
+ service. add(form, Random . userId(), bool() )
348
348
then :
349
349
1 * scottCatalogService. add(expectedNumbers)
350
350
and :
@@ -361,7 +361,7 @@ class SeriesServiceImplTest extends Specification {
361
361
and :
362
362
seriesDao. add(_ as AddSeriesDbDto ) >> expectedSeriesId
363
363
when :
364
- service. add(form, Random . userId(), false )
364
+ service. add(form, Random . userId(), bool() )
365
365
then :
366
366
1 * yvertCatalogService. add(expectedNumbers)
367
367
and :
@@ -378,7 +378,7 @@ class SeriesServiceImplTest extends Specification {
378
378
and :
379
379
seriesDao. add(_ as AddSeriesDbDto ) >> expectedSeriesId
380
380
when :
381
- service. add(form, Random . userId(), false )
381
+ service. add(form, Random . userId(), bool() )
382
382
then :
383
383
1 * gibbonsCatalogService. add(expectedNumbers)
384
384
and :
@@ -423,7 +423,7 @@ class SeriesServiceImplTest extends Specification {
423
423
given :
424
424
form. setImage(multipartFile)
425
425
when :
426
- service. add(form, Random . userId(), false )
426
+ service. add(form, Random . userId(), bool() )
427
427
then :
428
428
1 * imageService. save(multipartFile) >> TestObjects . createImageInfoDto()
429
429
}
@@ -436,7 +436,7 @@ class SeriesServiceImplTest extends Specification {
436
436
and :
437
437
Integer expectedImageId = Random . id()
438
438
when :
439
- service. add(form, Random . userId(), false )
439
+ service. add(form, Random . userId(), bool() )
440
440
then :
441
441
// FIXME: why we can't use _ as MultipartFile here?
442
442
imageService. save(_) >> new ImageInfoDto (expectedImageId, ' JPEG' )
@@ -452,7 +452,7 @@ class SeriesServiceImplTest extends Specification {
452
452
and :
453
453
imageService. addToSeries(_ as Integer , _ as Integer ) >> { throw new IllegalStateException () }
454
454
when :
455
- service. add(form, Random . userId(), false )
455
+ service. add(form, Random . userId(), bool() )
456
456
then :
457
457
imageService. save(_) >> expectedImageInfo
458
458
and :
0 commit comments