mirror of
https://github.com/gitbucket/gitbucket.git
synced 2026-05-07 02:07:05 +02:00
Merge pull request #2191 from ROki1988/add_fail_pattern_at_access-token
Add fail pattern at access token test
This commit is contained in:
@@ -3,7 +3,6 @@ package gitbucket.core.service
|
||||
import gitbucket.core.model._
|
||||
import org.scalatest.FunSuite
|
||||
import gitbucket.core.model.Profile._
|
||||
import gitbucket.core.model.Profile.profile._
|
||||
import gitbucket.core.model.Profile.profile.blockingApi._
|
||||
|
||||
class AccessTokenServiceSpec extends FunSuite with ServiceSpecBase {
|
||||
@@ -53,6 +52,7 @@ class AccessTokenServiceSpec extends FunSuite with ServiceSpecBase {
|
||||
val (id, token) = AccessTokenService.generateAccessToken("root", "note")
|
||||
assert(AccessTokenService.getAccountByAccessToken(token) match {
|
||||
case Some(user) => user.userName == "root"
|
||||
case _ => fail()
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -88,6 +88,7 @@ class AccessTokenServiceSpec extends FunSuite with ServiceSpecBase {
|
||||
|
||||
assert(AccessTokenService.getAccountByAccessToken(token) match {
|
||||
case Some(user) => user.userName == "user3"
|
||||
case _ => fail()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user