Skip to content

Commit d25cf53

Browse files
committed
SeriesServiceImplTest: reduce number of parameters by removing one that was duplicated.
Use expectedPrice instead of price because they have identical values. No functional changes.
1 parent c8b644d commit d25cf53

File tree

1 file changed

+20
-24
lines changed

1 file changed

+20
-24
lines changed

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

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,10 @@ class SeriesServiceImplTest extends Specification {
231231
'ClosureAsLastMethodParameter',
232232
'UnnecessaryReturnKeyword',
233233
'LineLength',
234-
/* false positive: */ 'UnnecessaryBooleanExpression',
235234
])
236-
def "add() should pass michel price and currency to series dao"(BigDecimal price, BigDecimal expectedPrice, String expectedCurrency) {
235+
def "add() should pass michel price and currency to series dao"(BigDecimal expectedPrice, String expectedCurrency) {
237236
given:
238-
form.setMichelPrice(price)
237+
form.setMichelPrice(expectedPrice)
239238
when:
240239
service.add(form, Random.userId(), false)
241240
then:
@@ -245,21 +244,20 @@ class SeriesServiceImplTest extends Specification {
245244
return true
246245
}) >> 123
247246
where:
248-
price || expectedPrice | expectedCurrency
249-
ANY_PRICE || ANY_PRICE | Currency.EUR.toString()
250-
null || null | null
247+
expectedPrice | expectedCurrency
248+
ANY_PRICE | Currency.EUR.toString()
249+
null | null
251250
}
252251

253252
@Unroll
254253
@SuppressWarnings([
255254
'ClosureAsLastMethodParameter',
256255
'LineLength',
257256
'UnnecessaryReturnKeyword',
258-
/* false positive: */ 'UnnecessaryBooleanExpression',
259257
])
260-
def "add() should pass scott price and currency to series dao"(BigDecimal price, BigDecimal expectedPrice, String expectedCurrency) {
258+
def "add() should pass scott price and currency to series dao"(BigDecimal expectedPrice, String expectedCurrency) {
261259
given:
262-
form.setScottPrice(price)
260+
form.setScottPrice(expectedPrice)
263261
when:
264262
service.add(form, Random.userId(), false)
265263
then:
@@ -269,21 +267,20 @@ class SeriesServiceImplTest extends Specification {
269267
return true
270268
}) >> 123
271269
where:
272-
price || expectedPrice | expectedCurrency
273-
ANY_PRICE || ANY_PRICE | Currency.USD.toString()
274-
null || null | null
270+
expectedPrice | expectedCurrency
271+
ANY_PRICE | Currency.USD.toString()
272+
null | null
275273
}
276274

277275
@Unroll
278276
@SuppressWarnings([
279277
'ClosureAsLastMethodParameter',
280278
'LineLength',
281279
'UnnecessaryReturnKeyword',
282-
/* false positive: */ 'UnnecessaryBooleanExpression',
283280
])
284-
def "add() should pass yvert price and currency to series dao"(BigDecimal price, BigDecimal expectedPrice, String expectedCurrency) {
281+
def "add() should pass yvert price and currency to series dao"(BigDecimal expectedPrice, String expectedCurrency) {
285282
given:
286-
form.setYvertPrice(price)
283+
form.setYvertPrice(expectedPrice)
287284
when:
288285
service.add(form, Random.userId(), false)
289286
then:
@@ -293,21 +290,20 @@ class SeriesServiceImplTest extends Specification {
293290
return true
294291
}) >> 123
295292
where:
296-
price || expectedPrice | expectedCurrency
297-
ANY_PRICE || ANY_PRICE | Currency.EUR.toString()
298-
null || null | null
293+
expectedPrice | expectedCurrency
294+
ANY_PRICE | Currency.EUR.toString()
295+
null | null
299296
}
300297

301298
@Unroll
302299
@SuppressWarnings([
303300
'ClosureAsLastMethodParameter',
304301
'LineLength',
305302
'UnnecessaryReturnKeyword',
306-
/* false positive: */ 'UnnecessaryBooleanExpression',
307303
])
308-
def "add() should pass gibbons price and currency to series dao"(BigDecimal price, BigDecimal expectedPrice, String expectedCurrency) {
304+
def "add() should pass gibbons price and currency to series dao"(BigDecimal expectedPrice, String expectedCurrency) {
309305
given:
310-
form.setGibbonsPrice(price)
306+
form.setGibbonsPrice(expectedPrice)
311307
when:
312308
service.add(form, Random.userId(), false)
313309
then:
@@ -317,9 +313,9 @@ class SeriesServiceImplTest extends Specification {
317313
return true
318314
}) >> 123
319315
where:
320-
price || expectedPrice | expectedCurrency
321-
ANY_PRICE || ANY_PRICE | Currency.GBP.toString()
322-
null || null | null
316+
expectedPrice | expectedCurrency
317+
ANY_PRICE | Currency.GBP.toString()
318+
null | null
323319
}
324320

325321
def "add() should throw exception if comment is empty"() {

0 commit comments

Comments
 (0)