@@ -57,7 +57,6 @@ class SeriesInfoExtractorServiceImplTest extends Specification {
57
57
result. isEmpty()
58
58
}
59
59
60
- @SuppressWarnings ([' ClosureAsLastMethodParameter' , ' UnnecessaryReturnKeyword' ])
61
60
def ' extractCategory() should try to search by category names' () {
62
61
given :
63
62
String fragment = ' Lorem ipsum dolor\t sit\n amet,'
@@ -67,26 +66,19 @@ class SeriesInfoExtractorServiceImplTest extends Specification {
67
66
when :
68
67
List<Integer > result = service. extractCategory(fragment)
69
68
then :
70
- 1 * categoryService. findIdsByNames({ Set<String > candidates ->
71
- assert candidates == expectedCandidates
72
- return true
73
- }) >> expectedResult
69
+ 1 * categoryService. findIdsByNames(expectedCandidates) >> expectedResult
74
70
and :
75
71
result == expectedResult
76
72
}
77
73
78
- @SuppressWarnings ([' ClosureAsLastMethodParameter' , ' UnnecessaryReturnKeyword' ])
79
74
def ' extractCategory() should deduplicate candidates' () {
80
75
given :
81
76
String fragment = ' foo bar foo'
82
77
Set<String > expectedCandidates = [ ' foo' , ' bar' ]
83
78
when :
84
79
service. extractCategory(fragment)
85
80
then :
86
- 1 * categoryService. findIdsByNames({ Set<String > candidates ->
87
- assert candidates == expectedCandidates
88
- return true
89
- }) >> Random . listOfIntegers()
81
+ 1 * categoryService. findIdsByNames(expectedCandidates) >> Random . listOfIntegers()
90
82
}
91
83
92
84
def ' extractCategory() should try to search category names with candidate as a prefix' () {
@@ -131,7 +123,6 @@ class SeriesInfoExtractorServiceImplTest extends Specification {
131
123
result. isEmpty()
132
124
}
133
125
134
- @SuppressWarnings ([' ClosureAsLastMethodParameter' , ' UnnecessaryReturnKeyword' ])
135
126
def ' extractCountry() should try to search by country names' () {
136
127
given :
137
128
String fragment = ' Lorem ipsum dolor\t sit\n amet,'
@@ -141,26 +132,19 @@ class SeriesInfoExtractorServiceImplTest extends Specification {
141
132
when :
142
133
List<Integer > result = service. extractCountry(fragment)
143
134
then :
144
- 1 * countryService. findIdsByNames({ Set<String > candidates ->
145
- assert candidates == expectedCandidates
146
- return true
147
- }) >> expectedResult
135
+ 1 * countryService. findIdsByNames(expectedCandidates) >> expectedResult
148
136
and :
149
137
result == expectedResult
150
138
}
151
139
152
- @SuppressWarnings ([' ClosureAsLastMethodParameter' , ' UnnecessaryReturnKeyword' ])
153
140
def ' extractCountry() should deduplicate candidates' () {
154
141
given :
155
142
String fragment = ' foo bar foo'
156
143
Set<String > expectedCandidates = [ ' foo' , ' bar' ]
157
144
when :
158
145
service. extractCountry(fragment)
159
146
then :
160
- 1 * countryService. findIdsByNames({ Set<String > candidates ->
161
- assert candidates == expectedCandidates
162
- return true
163
- }) >> Random . listOfIntegers()
147
+ 1 * countryService. findIdsByNames(expectedCandidates) >> Random . listOfIntegers()
164
148
}
165
149
166
150
def ' extractCountry() should try to search country names with candidate as a prefix' () {
0 commit comments