Skip to content

Commit 694c422

Browse files
committed
refactor(CategoryServiceImplTest): use single quotes in method names.
1 parent 66b5ae0 commit 694c422

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

src/test/groovy/ru/mystamps/web/feature/category/CategoryServiceImplTest.groovy

+25-25
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ class CategoryServiceImplTest extends Specification {
5757
// Tests for add()
5858
//
5959

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

68-
def "add() should throw exception when English category name is null"() {
68+
def 'add() should throw exception when English category name is null'() {
6969
given:
7070
form.setName(null)
7171
when:
@@ -75,15 +75,15 @@ class CategoryServiceImplTest extends Specification {
7575
ex.message == 'Category name in English must be non null'
7676
}
7777

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

86-
def "add() should call dao"() {
86+
def 'add() should call dao'() {
8787
given:
8888
Integer expectedId = 10
8989
and:
@@ -109,7 +109,7 @@ class CategoryServiceImplTest extends Specification {
109109
}
110110

111111
@SuppressWarnings(['ClosureAsLastMethodParameter', 'UnnecessaryReturnKeyword'])
112-
def "add() should pass slug to dao"() {
112+
def 'add() should pass slug to dao'() {
113113
given:
114114
String name = '-foo123 test_'
115115
and:
@@ -126,7 +126,7 @@ class CategoryServiceImplTest extends Specification {
126126
}
127127

128128
@SuppressWarnings(['ClosureAsLastMethodParameter', 'UnnecessaryReturnKeyword'])
129-
def "add() should pass values to dao"() {
129+
def 'add() should pass values to dao'() {
130130
given:
131131
Integer expectedUserId = 10
132132
String expectedEnglishName = 'Animals'
@@ -221,7 +221,7 @@ class CategoryServiceImplTest extends Specification {
221221
// Tests for findAllAsLinkEntities(String)
222222
//
223223

224-
def "findAllAsLinkEntities(String) should call dao"() {
224+
def 'findAllAsLinkEntities(String) should call dao'() {
225225
given:
226226
LinkEntityDto category1 = new LinkEntityDto(1, 'first-category', 'First Category')
227227
and:
@@ -289,7 +289,7 @@ class CategoryServiceImplTest extends Specification {
289289
'' | _
290290
}
291291

292-
def "findOneAsLinkEntity() should pass arguments to dao"() {
292+
def 'findOneAsLinkEntity() should pass arguments to dao'() {
293293
given:
294294
String expectedSlug = 'people'
295295
and:
@@ -308,7 +308,7 @@ class CategoryServiceImplTest extends Specification {
308308
// Tests for countAll()
309309
//
310310

311-
def "countAll() should call dao and returns result"() {
311+
def 'countAll() should call dao and returns result'() {
312312
given:
313313
long expectedResult = 10
314314
when:
@@ -323,15 +323,15 @@ class CategoryServiceImplTest extends Specification {
323323
// Tests for countCategoriesOf()
324324
//
325325

326-
def "countCategoriesOf() should throw exception when collection id is null"() {
326+
def 'countCategoriesOf() should throw exception when collection id is null'() {
327327
when:
328328
service.countCategoriesOf(null)
329329
then:
330330
IllegalArgumentException ex = thrown()
331331
ex.message == 'Collection id must be non null'
332332
}
333333

334-
def "countCategoriesOf() should pass arguments to dao"() {
334+
def 'countCategoriesOf() should pass arguments to dao'() {
335335
given:
336336
Integer expectedCollectionId = 10
337337
when:
@@ -344,15 +344,15 @@ class CategoryServiceImplTest extends Specification {
344344
// Tests for countBySlug()
345345
//
346346

347-
def "countBySlug() should throw exception when slug is null"() {
347+
def 'countBySlug() should throw exception when slug is null'() {
348348
when:
349349
service.countBySlug(null)
350350
then:
351351
IllegalArgumentException ex = thrown()
352352
ex.message == 'Category slug must be non null'
353353
}
354354

355-
def "countBySlug() should call dao"() {
355+
def 'countBySlug() should call dao'() {
356356
given:
357357
categoryDao.countBySlug(_ as String) >> 3L
358358
when:
@@ -365,15 +365,15 @@ class CategoryServiceImplTest extends Specification {
365365
// Tests for countByName()
366366
//
367367

368-
def "countByName() should throw exception when name is null"() {
368+
def 'countByName() should throw exception when name is null'() {
369369
when:
370370
service.countByName(null)
371371
then:
372372
IllegalArgumentException ex = thrown()
373373
ex.message == 'Name must be non null'
374374
}
375375

376-
def "countByName() should call dao"() {
376+
def 'countByName() should call dao'() {
377377
given:
378378
categoryDao.countByName(_ as String) >> 2L
379379
when:
@@ -382,7 +382,7 @@ class CategoryServiceImplTest extends Specification {
382382
result == 2L
383383
}
384384

385-
def "countByName() should pass category name to dao in lowercase"() {
385+
def 'countByName() should pass category name to dao in lowercase'() {
386386
when:
387387
service.countByName('Sport')
388388
then:
@@ -393,15 +393,15 @@ class CategoryServiceImplTest extends Specification {
393393
// Tests for countByNameRu()
394394
//
395395

396-
def "countByNameRu() should throw exception when name is null"() {
396+
def 'countByNameRu() should throw exception when name is null'() {
397397
when:
398398
service.countByNameRu(null)
399399
then:
400400
IllegalArgumentException ex = thrown()
401401
ex.message == 'Name in Russian must be non null'
402402
}
403403

404-
def "countByNameRu() should call dao"() {
404+
def 'countByNameRu() should call dao'() {
405405
given:
406406
categoryDao.countByNameRu(_ as String) >> 2L
407407
when:
@@ -410,7 +410,7 @@ class CategoryServiceImplTest extends Specification {
410410
result == 2L
411411
}
412412

413-
def "countByNameRu() should pass category name to dao in lowercase"() {
413+
def 'countByNameRu() should pass category name to dao in lowercase'() {
414414
when:
415415
service.countByNameRu('Спорт')
416416
then:
@@ -421,15 +421,15 @@ class CategoryServiceImplTest extends Specification {
421421
// Tests for countAddedSince()
422422
//
423423

424-
def "countAddedSince() should throw exception when date is null"() {
424+
def 'countAddedSince() should throw exception when date is null'() {
425425
when:
426426
service.countAddedSince(null)
427427
then:
428428
IllegalArgumentException ex = thrown()
429429
ex.message == 'Date must be non null'
430430
}
431431

432-
def "countAddedSince() should invoke dao, pass argument and return result from dao"() {
432+
def 'countAddedSince() should invoke dao, pass argument and return result from dao'() {
433433
given:
434434
Date expectedDate = new Date()
435435
and:
@@ -446,15 +446,15 @@ class CategoryServiceImplTest extends Specification {
446446
// Tests for countUntranslatedNamesSince()
447447
//
448448

449-
def "countUntranslatedNamesSince() should throw exception when date is null"() {
449+
def 'countUntranslatedNamesSince() should throw exception when date is null'() {
450450
when:
451451
service.countUntranslatedNamesSince(null)
452452
then:
453453
IllegalArgumentException ex = thrown()
454454
ex.message == 'Date must be non null'
455455
}
456456

457-
def "countUntranslatedNamesSince() should invoke dao, pass argument and return result from dao"() {
457+
def 'countUntranslatedNamesSince() should invoke dao, pass argument and return result from dao'() {
458458
given:
459459
Date expectedDate = new Date()
460460
and:
@@ -471,15 +471,15 @@ class CategoryServiceImplTest extends Specification {
471471
// Tests for getStatisticsOf()
472472
//
473473

474-
def "getStatisticsOf() should throw exception when collection id is null"() {
474+
def 'getStatisticsOf() should throw exception when collection id is null'() {
475475
when:
476476
service.getStatisticsOf(null, 'whatever')
477477
then:
478478
IllegalArgumentException ex = thrown()
479479
ex.message == 'Collection id must be non null'
480480
}
481481

482-
def "getStatisticsOf() should pass arguments to dao"() {
482+
def 'getStatisticsOf() should pass arguments to dao'() {
483483
given:
484484
Integer expectedCollectionId = 15
485485
and:

0 commit comments

Comments
 (0)