Skip to content

Commit 808c308

Browse files
committed
DatabaseImagePersistenceStrategyTest: merge 2 tests into one.
No functional changes.
1 parent 8f5e003 commit 808c308

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

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

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,28 +52,18 @@ class DatabaseImagePersistenceStrategyTest extends Specification {
5252
}
5353

5454
@SuppressWarnings(['ClosureAsLastMethodParameter', 'UnnecessaryReturnKeyword'])
55-
def "save() should pass file content to image data dao"() {
55+
def "save() should pass dto to image data dao"() {
5656
given:
57+
Integer expectedImageId = imageInfoDto.id
58+
and:
5759
byte[] expected = 'test'.bytes
5860
multipartFile.bytes >> expected
5961
when:
6062
strategy.save(multipartFile, imageInfoDto)
61-
then:
62-
1 * imageDataDao.add({ AddImageDataDbDto imageData ->
63-
assert imageData?.content == expected
64-
return true
65-
})
66-
}
67-
68-
@SuppressWarnings(['ClosureAsLastMethodParameter', 'UnnecessaryReturnKeyword'])
69-
def "save() should pass image to image data dao"() {
70-
given:
71-
Integer expectedImageId = imageInfoDto.id
72-
when:
73-
strategy.save(multipartFile, imageInfoDto)
7463
then:
7564
1 * imageDataDao.add({ AddImageDataDbDto imageData ->
7665
assert imageData?.imageId == expectedImageId
66+
assert imageData?.content == expected
7767
return true
7868
})
7969
}

0 commit comments

Comments
 (0)