File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
src/test/groovy/ru/mystamps/web/service Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -181,4 +181,34 @@ class UsersActivationServiceImplTest extends Specification {
181
181
1 * jdbcUsersActivationDao. countByActivationKey(' 0987654321' )
182
182
}
183
183
184
+ //
185
+ // Tests for remove()
186
+ //
187
+
188
+ def " remove() should throw exception when argument is null" () {
189
+ when :
190
+ service. remove(null )
191
+ then :
192
+ thrown IllegalArgumentException
193
+ }
194
+
195
+ def " remove() should throw exception when activation key is null" () {
196
+ given :
197
+ UsersActivation activation = TestObjects . createUsersActivation()
198
+ activation. setActivationKey(null )
199
+ when :
200
+ service. remove(activation)
201
+ then :
202
+ thrown IllegalArgumentException
203
+ }
204
+
205
+ def " remove() should pass argument to DAO method" () {
206
+ given :
207
+ UsersActivation activation = TestObjects . createUsersActivation()
208
+ when :
209
+ service. remove(activation)
210
+ then :
211
+ 1 * jdbcUsersActivationDao. removeByActivationKey(activation. getActivationKey())
212
+ }
213
+
184
214
}
You can’t perform that action at this time.
0 commit comments