mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-05 04:56:02 +01:00
fix test's inheritances
This commit is contained in:
@@ -14,7 +14,7 @@ import java.io.File
|
|||||||
class MergeServiceSpec extends FunSpec {
|
class MergeServiceSpec extends FunSpec {
|
||||||
val service = new MergeService with AccountService with ActivityService with IssuesService with LabelsService
|
val service = new MergeService with AccountService with ActivityService with IssuesService with LabelsService
|
||||||
with MilestonesService with RepositoryService with PrioritiesService with PullRequestService with CommitsService
|
with MilestonesService with RepositoryService with PrioritiesService with PullRequestService with CommitsService
|
||||||
with WebHookPullRequestService {}
|
with WebHookPullRequestService with WebHookPullRequestReviewCommentService {}
|
||||||
val branch = "master"
|
val branch = "master"
|
||||||
val issueId = 10
|
val issueId = 10
|
||||||
def initRepository(owner: String, name: String): File = {
|
def initRepository(owner: String, name: String): File = {
|
||||||
|
|||||||
@@ -9,11 +9,15 @@ class PullRequestServiceSpec
|
|||||||
with PullRequestService
|
with PullRequestService
|
||||||
with IssuesService
|
with IssuesService
|
||||||
with AccountService
|
with AccountService
|
||||||
|
with ActivityService
|
||||||
with RepositoryService
|
with RepositoryService
|
||||||
with CommitsService
|
with CommitsService
|
||||||
with LabelsService
|
with LabelsService
|
||||||
with MilestonesService
|
with MilestonesService
|
||||||
with PrioritiesService {
|
with PrioritiesService
|
||||||
|
with WebHookService
|
||||||
|
with WebHookPullRequestService
|
||||||
|
with WebHookPullRequestReviewCommentService {
|
||||||
|
|
||||||
def swap(r: (Issue, PullRequest)) = (r._2 -> r._1)
|
def swap(r: (Issue, PullRequest)) = (r._2 -> r._1)
|
||||||
|
|
||||||
|
|||||||
@@ -43,8 +43,10 @@ trait ServiceSpecBase {
|
|||||||
|
|
||||||
def user(name: String)(implicit s: Session): Account = AccountService.getAccountByUserName(name).get
|
def user(name: String)(implicit s: Session): Account = AccountService.getAccountByUserName(name).get
|
||||||
|
|
||||||
lazy val dummyService = new RepositoryService with AccountService with IssuesService with PullRequestService
|
lazy val dummyService = new RepositoryService with AccountService with ActivityService with IssuesService
|
||||||
with CommitsService with CommitStatusService with LabelsService with MilestonesService with PrioritiesService() {}
|
with PullRequestService with CommitsService with CommitStatusService with LabelsService with MilestonesService
|
||||||
|
with PrioritiesService with WebHookService with WebHookPullRequestService
|
||||||
|
with WebHookPullRequestReviewCommentService {}
|
||||||
|
|
||||||
def generateNewUserWithDBRepository(userName: String, repositoryName: String)(implicit s: Session): Account = {
|
def generateNewUserWithDBRepository(userName: String, repositoryName: String)(implicit s: Session): Account = {
|
||||||
val ac = AccountService.getAccountByUserName(userName).getOrElse(generateNewAccount(userName))
|
val ac = AccountService.getAccountByUserName(userName).getOrElse(generateNewAccount(userName))
|
||||||
|
|||||||
@@ -5,8 +5,9 @@ import org.scalatest.FunSuite
|
|||||||
import gitbucket.core.model.WebHookContentType
|
import gitbucket.core.model.WebHookContentType
|
||||||
|
|
||||||
class WebHookServiceSpec extends FunSuite with ServiceSpecBase {
|
class WebHookServiceSpec extends FunSuite with ServiceSpecBase {
|
||||||
lazy val service = new WebHookPullRequestService with AccountService with RepositoryService with PullRequestService
|
lazy val service = new WebHookPullRequestService with AccountService with ActivityService with RepositoryService
|
||||||
with IssuesService with CommitsService with LabelsService with MilestonesService with PrioritiesService
|
with PullRequestService with IssuesService with CommitsService with LabelsService with MilestonesService
|
||||||
|
with PrioritiesService with WebHookPullRequestReviewCommentService
|
||||||
|
|
||||||
test("WebHookPullRequestService.getPullRequestsByRequestForWebhook") {
|
test("WebHookPullRequestService.getPullRequestsByRequestForWebhook") {
|
||||||
withTestDB { implicit session =>
|
withTestDB { implicit session =>
|
||||||
|
|||||||
Reference in New Issue
Block a user