Skip to content

Commit 1492b5f

Browse files
committed
TimedImagePreviewStrategyTest: simplify code by replacing closure with expected value.
No functional changes.
1 parent cce8dab commit 1492b5f

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

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

+2-11
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,12 @@ class TimedImagePreviewStrategyTest extends Specification {
3838
//
3939

4040
@Unroll
41-
@SuppressWarnings([
42-
'ClosureAsLastMethodParameter',
43-
'FactoryMethodName',
44-
'LineLength',
45-
'UnnecessaryReturnKeyword',
46-
/* false positive: */ 'UnnecessaryBooleanExpression',
47-
])
41+
@SuppressWarnings([ 'FactoryMethodName', 'LineLength', /* false positive: */ 'UnnecessaryBooleanExpression' ])
4842
def 'createPreview() should pass #expectedData and return #expectedResult'(byte[] expectedData, byte[] expectedResult) {
4943
when:
5044
byte[] result = strategy.createPreview(expectedData)
5145
then:
52-
1 * origStrategy.createPreview({ byte[] image ->
53-
image == expectedData
54-
return true
55-
}) >> expectedResult
46+
1 * origStrategy.createPreview(expectedData) >> expectedResult
5647
and:
5748
result == expectedResult
5849
where:

0 commit comments

Comments
 (0)