@@ -56,15 +56,15 @@ class CountryServiceImplTest extends Specification {
56
56
// Tests for add()
57
57
//
58
58
59
- def " add() should throw exception when dto is null" () {
59
+ def ' add() should throw exception when dto is null' () {
60
60
when :
61
61
service. add(null , Random . userId())
62
62
then :
63
63
IllegalArgumentException ex = thrown()
64
64
ex. message == ' DTO must be non null'
65
65
}
66
66
67
- def " add() should throw exception when country name in English is null" () {
67
+ def ' add() should throw exception when country name in English is null' () {
68
68
given :
69
69
form. setName(null )
70
70
when :
@@ -74,15 +74,15 @@ class CountryServiceImplTest extends Specification {
74
74
ex. message == ' Country name in English must be non null'
75
75
}
76
76
77
- def " add() should throw exception when user is null" () {
77
+ def ' add() should throw exception when user is null' () {
78
78
when :
79
79
service. add(form, null )
80
80
then :
81
81
IllegalArgumentException ex = thrown()
82
82
ex. message == ' User id must be non null'
83
83
}
84
84
85
- def " add() should call dao" () {
85
+ def ' add() should call dao' () {
86
86
given :
87
87
Integer expectedId = 10
88
88
and :
@@ -108,7 +108,7 @@ class CountryServiceImplTest extends Specification {
108
108
}
109
109
110
110
@SuppressWarnings ([' ClosureAsLastMethodParameter' , ' UnnecessaryReturnKeyword' ])
111
- def " add() should pass slug to dao" () {
111
+ def ' add() should pass slug to dao' () {
112
112
given :
113
113
String name = ' -foo123 test_'
114
114
and :
@@ -125,7 +125,7 @@ class CountryServiceImplTest extends Specification {
125
125
}
126
126
127
127
@SuppressWarnings ([' ClosureAsLastMethodParameter' , ' UnnecessaryReturnKeyword' ])
128
- def " add() should pass values to dao" () {
128
+ def ' add() should pass values to dao' () {
129
129
given :
130
130
Integer expectedUserId = 10
131
131
String expectedEnglishName = ' Italy'
@@ -220,7 +220,7 @@ class CountryServiceImplTest extends Specification {
220
220
// Tests for findAllAsLinkEntities(String)
221
221
//
222
222
223
- def " findAllAsLinkEntities(String) should call dao" () {
223
+ def ' findAllAsLinkEntities(String) should call dao' () {
224
224
given :
225
225
LinkEntityDto country1 = new LinkEntityDto (1 , ' first-country' , ' First Country' )
226
226
and :
@@ -272,7 +272,7 @@ class CountryServiceImplTest extends Specification {
272
272
' ' | _
273
273
}
274
274
275
- def " findOneAsLinkEntity() should pass arguments to dao" () {
275
+ def ' findOneAsLinkEntity() should pass arguments to dao' () {
276
276
given :
277
277
String expectedSlug = ' france'
278
278
and :
@@ -291,7 +291,7 @@ class CountryServiceImplTest extends Specification {
291
291
// Tests for countAll()
292
292
//
293
293
294
- def " countAll() should call dao and returns result" () {
294
+ def ' countAll() should call dao and returns result' () {
295
295
given :
296
296
long expectedResult = 20
297
297
when :
@@ -306,15 +306,15 @@ class CountryServiceImplTest extends Specification {
306
306
// Tests for countCountriesOf()
307
307
//
308
308
309
- def " countCountriesOf() should throw exception when collection id is null" () {
309
+ def ' countCountriesOf() should throw exception when collection id is null' () {
310
310
when :
311
311
service. countCountriesOf(null )
312
312
then :
313
313
IllegalArgumentException ex = thrown()
314
314
ex. message == ' Collection id must be non null'
315
315
}
316
316
317
- def " countCountriesOf() should pass arguments to dao" () {
317
+ def ' countCountriesOf() should pass arguments to dao' () {
318
318
given :
319
319
Integer expectedCollectionId = 9
320
320
when :
@@ -327,15 +327,15 @@ class CountryServiceImplTest extends Specification {
327
327
// Tests for countBySlug()
328
328
//
329
329
330
- def " countBySlug() should throw exception when slug is null" () {
330
+ def ' countBySlug() should throw exception when slug is null' () {
331
331
when :
332
332
service. countBySlug(null )
333
333
then :
334
334
IllegalArgumentException ex = thrown()
335
335
ex. message == ' Country slug must be non null'
336
336
}
337
337
338
- def " countBySlug() should call dao" () {
338
+ def ' countBySlug() should call dao' () {
339
339
given :
340
340
countryDao. countBySlug(_ as String ) >> 3L
341
341
when :
@@ -348,15 +348,15 @@ class CountryServiceImplTest extends Specification {
348
348
// Tests for countByName()
349
349
//
350
350
351
- def " countByName() should throw exception when name is null" () {
351
+ def ' countByName() should throw exception when name is null' () {
352
352
when :
353
353
service. countByName(null )
354
354
then :
355
355
IllegalArgumentException ex = thrown()
356
356
ex. message == ' Name must be non null'
357
357
}
358
358
359
- def " countByName() should call dao" () {
359
+ def ' countByName() should call dao' () {
360
360
given :
361
361
countryDao. countByName(_ as String ) >> 2L
362
362
when :
@@ -365,7 +365,7 @@ class CountryServiceImplTest extends Specification {
365
365
result == 2L
366
366
}
367
367
368
- def " countByName() should pass country name to dao in lowercase" () {
368
+ def ' countByName() should pass country name to dao in lowercase' () {
369
369
when :
370
370
service. countByName(' Canada' )
371
371
then :
@@ -376,15 +376,15 @@ class CountryServiceImplTest extends Specification {
376
376
// Tests for countByNameRu()
377
377
//
378
378
379
- def " countByNameRu() should throw exception when name is null" () {
379
+ def ' countByNameRu() should throw exception when name is null' () {
380
380
when :
381
381
service. countByNameRu(null )
382
382
then :
383
383
IllegalArgumentException ex = thrown()
384
384
ex. message == ' Name in Russian must be non null'
385
385
}
386
386
387
- def " countByNameRu() should call dao" () {
387
+ def ' countByNameRu() should call dao' () {
388
388
given :
389
389
countryDao. countByNameRu(_ as String ) >> 2L
390
390
when :
@@ -393,7 +393,7 @@ class CountryServiceImplTest extends Specification {
393
393
result == 2L
394
394
}
395
395
396
- def " countByNameRu() should pass category name to dao in lowercase" () {
396
+ def ' countByNameRu() should pass category name to dao in lowercase' () {
397
397
when :
398
398
service. countByNameRu(' Канада' )
399
399
then :
@@ -404,15 +404,15 @@ class CountryServiceImplTest extends Specification {
404
404
// Tests for countAddedSince()
405
405
//
406
406
407
- def " countAddedSince() should throw exception when date is null" () {
407
+ def ' countAddedSince() should throw exception when date is null' () {
408
408
when :
409
409
service. countAddedSince(null )
410
410
then :
411
411
IllegalArgumentException ex = thrown()
412
412
ex. message == ' Date must be non null'
413
413
}
414
414
415
- def " countAddedSince() should invoke dao, pass argument and return result from dao" () {
415
+ def ' countAddedSince() should invoke dao, pass argument and return result from dao' () {
416
416
given :
417
417
Date expectedDate = new Date ()
418
418
and :
@@ -429,15 +429,15 @@ class CountryServiceImplTest extends Specification {
429
429
// Tests for countUntranslatedNamesSince()
430
430
//
431
431
432
- def " countUntranslatedNamesSince() should throw exception when date is null" () {
432
+ def ' countUntranslatedNamesSince() should throw exception when date is null' () {
433
433
when :
434
434
service. countUntranslatedNamesSince(null )
435
435
then :
436
436
IllegalArgumentException ex = thrown()
437
437
ex. message == ' Date must be non null'
438
438
}
439
439
440
- def " countUntranslatedNamesSince() should invoke dao, pass argument and return result from dao" () {
440
+ def ' countUntranslatedNamesSince() should invoke dao, pass argument and return result from dao' () {
441
441
given :
442
442
Date expectedDate = new Date ()
443
443
and :
@@ -454,15 +454,15 @@ class CountryServiceImplTest extends Specification {
454
454
// Tests for getStatisticsOf()
455
455
//
456
456
457
- def " getStatisticsOf() should throw exception when collection id is null" () {
457
+ def ' getStatisticsOf() should throw exception when collection id is null' () {
458
458
when :
459
459
service. getStatisticsOf(null , ' whatever' )
460
460
then :
461
461
IllegalArgumentException ex = thrown()
462
462
ex. message == ' Collection id must be non null'
463
463
}
464
464
465
- def " getStatisticsOf() should pass arguments to dao" () {
465
+ def ' getStatisticsOf() should pass arguments to dao' () {
466
466
given :
467
467
Integer expectedCollectionId = 17
468
468
and :
0 commit comments