File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
src/test/groovy/ru/mystamps/web/service Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,27 @@ class DatabaseImagePersistenceStrategyTest extends Specification {
69
69
})
70
70
}
71
71
72
+ //
73
+ // Tests for savePreview()
74
+ //
75
+
76
+ @SuppressWarnings ([' ClosureAsLastMethodParameter' , ' UnnecessaryReturnKeyword' ])
77
+ def " savePreview() should pass dto to image data dao" () {
78
+ given :
79
+ Integer expectedImageId = imageInfoDto. id
80
+ and :
81
+ byte [] expectedContent = ' test' . bytes
82
+ when :
83
+ strategy. savePreview(expectedContent, imageInfoDto)
84
+ then :
85
+ 1 * imageDataDao. add({ AddImageDataDbDto imageData ->
86
+ assert imageData?. imageId == expectedImageId
87
+ assert imageData?. content == expectedContent
88
+ assert imageData?. preview == true
89
+ return true
90
+ })
91
+ }
92
+
72
93
//
73
94
// Tests for get()
74
95
//
You can’t perform that action at this time.
0 commit comments