mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 14:05:52 +01:00
Fix test case.
This commit is contained in:
@@ -147,4 +147,4 @@ trait AccountService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//object AccountService extends AccountService
|
object AccountService extends AccountService
|
||||||
@@ -9,7 +9,7 @@ class AccountServiceServiceSpec extends Specification with ServiceSpecBase {
|
|||||||
val RootMailAddress = "root@localhost"
|
val RootMailAddress = "root@localhost"
|
||||||
|
|
||||||
"getAllUsers" in { withTestDB{
|
"getAllUsers" in { withTestDB{
|
||||||
AccountService.getAllUsers must be like{
|
AccountService.getAllUsers() must be like{
|
||||||
case List(model.Account("root", "root", RootMailAddress, _, true, _, _, _, None, None, false, false)) => ok
|
case List(model.Account("root", "root", RootMailAddress, _, true, _, _, _, None, None, false, false)) => ok
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
@@ -75,3 +75,4 @@ class AccountServiceServiceSpec extends Specification with ServiceSpecBase {
|
|||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,7 @@ import java.io.File
|
|||||||
trait ServiceSpecBase {
|
trait ServiceSpecBase {
|
||||||
|
|
||||||
def withTestDB[A](action: => A): A = {
|
def withTestDB[A](action: => A): A = {
|
||||||
util.FileUtil.withTmpDir(new File(FileUtils.getTempDirectory(), Random.alphanumeric.take(10).mkString)){
|
util.FileUtil.withTmpDir(new File(FileUtils.getTempDirectory(), Random.alphanumeric.take(10).mkString)){ dir =>
|
||||||
dir =>
|
|
||||||
val (url, user, pass) = (s"jdbc:h2:${dir}", "sa", "sa")
|
val (url, user, pass) = (s"jdbc:h2:${dir}", "sa", "sa")
|
||||||
org.h2.Driver.load()
|
org.h2.Driver.load()
|
||||||
using(DriverManager.getConnection(url, user, pass)){ conn =>
|
using(DriverManager.getConnection(url, user, pass)){ conn =>
|
||||||
|
|||||||
Reference in New Issue
Block a user