Skip to content

Commit c8b644d

Browse files
committed
SeriesServiceImplTest: simplify "findFullInfoById() should return info about series" test.
No functional changes.
1 parent 7d3776d commit c8b644d

File tree

1 file changed

+7
-28
lines changed

1 file changed

+7
-28
lines changed

src/test/groovy/ru/mystamps/web/service/SeriesServiceImplTest.groovy

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ class SeriesServiceImplTest extends Specification {
841841
result == null
842842
}
843843

844-
@SuppressWarnings(['ClosureAsLastMethodParameter', 'UnnecessaryReturnKeyword', 'UnnecessaryObjectReferences'])
844+
@SuppressWarnings('UnnecessaryObjectReferences')
845845
def "findFullInfoById() should return info about series"() {
846846
given:
847847
Integer expectedSeriesId = 20
@@ -855,38 +855,17 @@ class SeriesServiceImplTest extends Specification {
855855
when:
856856
SeriesDto result = service.findFullInfoById(expectedSeriesId, expectedLang)
857857
then:
858-
1 * seriesDao.findByIdAsSeriesFullInfo({ Integer seriesId ->
859-
assert seriesId == expectedSeriesId
860-
return true
861-
}, { String lang ->
862-
assert lang == expectedLang
863-
return true
864-
}) >> expectedInfo
858+
1 * seriesDao.findByIdAsSeriesFullInfo(expectedSeriesId, expectedLang) >> expectedInfo
865859
and:
866-
1 * michelCatalogService.findBySeriesId({ Integer seriesId ->
867-
assert seriesId == expectedSeriesId
868-
return true
869-
}) >> expectedMichelNumbers
860+
1 * michelCatalogService.findBySeriesId(expectedSeriesId) >> expectedMichelNumbers
870861
and:
871-
1 * scottCatalogService.findBySeriesId({ Integer seriesId ->
872-
assert seriesId == expectedSeriesId
873-
return true
874-
}) >> expectedScottNumbers
862+
1 * scottCatalogService.findBySeriesId(expectedSeriesId) >> expectedScottNumbers
875863
and:
876-
1 * yvertCatalogService.findBySeriesId({ Integer seriesId ->
877-
assert seriesId == expectedSeriesId
878-
return true
879-
}) >> expectedYvertNumbers
864+
1 * yvertCatalogService.findBySeriesId(expectedSeriesId) >> expectedYvertNumbers
880865
and:
881-
1 * gibbonsCatalogService.findBySeriesId({ Integer seriesId ->
882-
assert seriesId == expectedSeriesId
883-
return true
884-
}) >> expectedGibbonsNumbers
866+
1 * gibbonsCatalogService.findBySeriesId(expectedSeriesId) >> expectedGibbonsNumbers
885867
and:
886-
1 * imageService.findBySeriesId({ Integer seriesId ->
887-
assert seriesId == expectedSeriesId
888-
return true
889-
}) >> expectedImageIds
868+
1 * imageService.findBySeriesId(expectedSeriesId) >> expectedImageIds
890869
and:
891870
result != null
892871
result.id == expectedInfo.id

0 commit comments

Comments
 (0)