Skip to content

Commit 544b581

Browse files
committed
SiteServiceImplTest: add missing tests for testing that logAboutFailedAuthentication() passes method to dao.
Should be in cbd6079 commit. No functional changes.
1 parent e47202f commit 544b581

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,20 @@ class SiteServiceImplTest extends Specification {
304304
})
305305
}
306306

307+
@Unroll
308+
def "logAboutFailedAuthentication() should pass method to dao"(String expectedMethod) {
309+
when:
310+
service.logAboutFailedAuthentication(TEST_PAGE, expectedMethod, null, null, null, null, null)
311+
then:
312+
1 * suspiciousActivityDao.add({ AddSuspiciousActivityDbDto activity ->
313+
assert activity?.method == expectedMethod
314+
return true
315+
})
316+
where: expectedMethod | _
317+
'OPTIONS' | _
318+
null | _
319+
}
320+
307321
def "logAboutFailedAuthentication() should pass null to dao for unknown user"() {
308322
when:
309323
service.logAboutFailedAuthentication(TEST_PAGE, TEST_METHOD, null, null, null, null, null)

0 commit comments

Comments
 (0)