Skip to content

Commit f6c82ec

Browse files
committed
refactor(CountryServiceImplTest): use single quotes in method names.
1 parent 585fd81 commit f6c82ec

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

src/test/groovy/ru/mystamps/web/feature/country/CountryServiceImplTest.groovy

+25-25
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ class CountryServiceImplTest extends Specification {
5656
// Tests for add()
5757
//
5858

59-
def "add() should throw exception when dto is null"() {
59+
def 'add() should throw exception when dto is null'() {
6060
when:
6161
service.add(null, Random.userId())
6262
then:
6363
IllegalArgumentException ex = thrown()
6464
ex.message == 'DTO must be non null'
6565
}
6666

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'() {
6868
given:
6969
form.setName(null)
7070
when:
@@ -74,15 +74,15 @@ class CountryServiceImplTest extends Specification {
7474
ex.message == 'Country name in English must be non null'
7575
}
7676

77-
def "add() should throw exception when user is null"() {
77+
def 'add() should throw exception when user is null'() {
7878
when:
7979
service.add(form, null)
8080
then:
8181
IllegalArgumentException ex = thrown()
8282
ex.message == 'User id must be non null'
8383
}
8484

85-
def "add() should call dao"() {
85+
def 'add() should call dao'() {
8686
given:
8787
Integer expectedId = 10
8888
and:
@@ -108,7 +108,7 @@ class CountryServiceImplTest extends Specification {
108108
}
109109

110110
@SuppressWarnings(['ClosureAsLastMethodParameter', 'UnnecessaryReturnKeyword'])
111-
def "add() should pass slug to dao"() {
111+
def 'add() should pass slug to dao'() {
112112
given:
113113
String name = '-foo123 test_'
114114
and:
@@ -125,7 +125,7 @@ class CountryServiceImplTest extends Specification {
125125
}
126126

127127
@SuppressWarnings(['ClosureAsLastMethodParameter', 'UnnecessaryReturnKeyword'])
128-
def "add() should pass values to dao"() {
128+
def 'add() should pass values to dao'() {
129129
given:
130130
Integer expectedUserId = 10
131131
String expectedEnglishName = 'Italy'
@@ -220,7 +220,7 @@ class CountryServiceImplTest extends Specification {
220220
// Tests for findAllAsLinkEntities(String)
221221
//
222222

223-
def "findAllAsLinkEntities(String) should call dao"() {
223+
def 'findAllAsLinkEntities(String) should call dao'() {
224224
given:
225225
LinkEntityDto country1 = new LinkEntityDto(1, 'first-country', 'First Country')
226226
and:
@@ -272,7 +272,7 @@ class CountryServiceImplTest extends Specification {
272272
'' | _
273273
}
274274

275-
def "findOneAsLinkEntity() should pass arguments to dao"() {
275+
def 'findOneAsLinkEntity() should pass arguments to dao'() {
276276
given:
277277
String expectedSlug = 'france'
278278
and:
@@ -291,7 +291,7 @@ class CountryServiceImplTest extends Specification {
291291
// Tests for countAll()
292292
//
293293

294-
def "countAll() should call dao and returns result"() {
294+
def 'countAll() should call dao and returns result'() {
295295
given:
296296
long expectedResult = 20
297297
when:
@@ -306,15 +306,15 @@ class CountryServiceImplTest extends Specification {
306306
// Tests for countCountriesOf()
307307
//
308308

309-
def "countCountriesOf() should throw exception when collection id is null"() {
309+
def 'countCountriesOf() should throw exception when collection id is null'() {
310310
when:
311311
service.countCountriesOf(null)
312312
then:
313313
IllegalArgumentException ex = thrown()
314314
ex.message == 'Collection id must be non null'
315315
}
316316

317-
def "countCountriesOf() should pass arguments to dao"() {
317+
def 'countCountriesOf() should pass arguments to dao'() {
318318
given:
319319
Integer expectedCollectionId = 9
320320
when:
@@ -327,15 +327,15 @@ class CountryServiceImplTest extends Specification {
327327
// Tests for countBySlug()
328328
//
329329

330-
def "countBySlug() should throw exception when slug is null"() {
330+
def 'countBySlug() should throw exception when slug is null'() {
331331
when:
332332
service.countBySlug(null)
333333
then:
334334
IllegalArgumentException ex = thrown()
335335
ex.message == 'Country slug must be non null'
336336
}
337337

338-
def "countBySlug() should call dao"() {
338+
def 'countBySlug() should call dao'() {
339339
given:
340340
countryDao.countBySlug(_ as String) >> 3L
341341
when:
@@ -348,15 +348,15 @@ class CountryServiceImplTest extends Specification {
348348
// Tests for countByName()
349349
//
350350

351-
def "countByName() should throw exception when name is null"() {
351+
def 'countByName() should throw exception when name is null'() {
352352
when:
353353
service.countByName(null)
354354
then:
355355
IllegalArgumentException ex = thrown()
356356
ex.message == 'Name must be non null'
357357
}
358358

359-
def "countByName() should call dao"() {
359+
def 'countByName() should call dao'() {
360360
given:
361361
countryDao.countByName(_ as String) >> 2L
362362
when:
@@ -365,7 +365,7 @@ class CountryServiceImplTest extends Specification {
365365
result == 2L
366366
}
367367

368-
def "countByName() should pass country name to dao in lowercase"() {
368+
def 'countByName() should pass country name to dao in lowercase'() {
369369
when:
370370
service.countByName('Canada')
371371
then:
@@ -376,15 +376,15 @@ class CountryServiceImplTest extends Specification {
376376
// Tests for countByNameRu()
377377
//
378378

379-
def "countByNameRu() should throw exception when name is null"() {
379+
def 'countByNameRu() should throw exception when name is null'() {
380380
when:
381381
service.countByNameRu(null)
382382
then:
383383
IllegalArgumentException ex = thrown()
384384
ex.message == 'Name in Russian must be non null'
385385
}
386386

387-
def "countByNameRu() should call dao"() {
387+
def 'countByNameRu() should call dao'() {
388388
given:
389389
countryDao.countByNameRu(_ as String) >> 2L
390390
when:
@@ -393,7 +393,7 @@ class CountryServiceImplTest extends Specification {
393393
result == 2L
394394
}
395395

396-
def "countByNameRu() should pass category name to dao in lowercase"() {
396+
def 'countByNameRu() should pass category name to dao in lowercase'() {
397397
when:
398398
service.countByNameRu('Канада')
399399
then:
@@ -404,15 +404,15 @@ class CountryServiceImplTest extends Specification {
404404
// Tests for countAddedSince()
405405
//
406406

407-
def "countAddedSince() should throw exception when date is null"() {
407+
def 'countAddedSince() should throw exception when date is null'() {
408408
when:
409409
service.countAddedSince(null)
410410
then:
411411
IllegalArgumentException ex = thrown()
412412
ex.message == 'Date must be non null'
413413
}
414414

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'() {
416416
given:
417417
Date expectedDate = new Date()
418418
and:
@@ -429,15 +429,15 @@ class CountryServiceImplTest extends Specification {
429429
// Tests for countUntranslatedNamesSince()
430430
//
431431

432-
def "countUntranslatedNamesSince() should throw exception when date is null"() {
432+
def 'countUntranslatedNamesSince() should throw exception when date is null'() {
433433
when:
434434
service.countUntranslatedNamesSince(null)
435435
then:
436436
IllegalArgumentException ex = thrown()
437437
ex.message == 'Date must be non null'
438438
}
439439

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'() {
441441
given:
442442
Date expectedDate = new Date()
443443
and:
@@ -454,15 +454,15 @@ class CountryServiceImplTest extends Specification {
454454
// Tests for getStatisticsOf()
455455
//
456456

457-
def "getStatisticsOf() should throw exception when collection id is null"() {
457+
def 'getStatisticsOf() should throw exception when collection id is null'() {
458458
when:
459459
service.getStatisticsOf(null, 'whatever')
460460
then:
461461
IllegalArgumentException ex = thrown()
462462
ex.message == 'Collection id must be non null'
463463
}
464464

465-
def "getStatisticsOf() should pass arguments to dao"() {
465+
def 'getStatisticsOf() should pass arguments to dao'() {
466466
given:
467467
Integer expectedCollectionId = 17
468468
and:

0 commit comments

Comments
 (0)