-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathConstants.scala
49 lines (39 loc) · 1.56 KB
/
Constants.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import com.ning.http.client.AsyncHttpClient
import codecheck.github.api.GitHubAPI
import scala.concurrent.duration._
import scala.util.Random._
import org.scalatest.time.Span._
import org.scalatest.concurrent.ScalaFutures
trait Constants {
import scala.language.postfixOps
protected val TIMEOUT = 5 seconds
protected val api = Constants.API
//Request membership of dummy organization "celestialbeing" if you are not member. Do not edit.
protected val organization = "celestialbeings"
protected val repo = "test-repo"
//Other Options
private val debug = sys.env.get("DEBUG")
.map(v => v.equalsIgnoreCase("true") || v.equalsIgnoreCase("yes")).getOrElse(false)
protected def showResponse(v: Any): Unit = {
if (debug) {
println(v)
}
}
protected val user = sys.env("GITHUB_USER")
protected val userRepo = sys.env("GITHUB_REPO")
protected val otherUser = "shunjikonishi"
protected val collaboratorUser = "givery-dev"
protected val otherUserInvalid = "loremipsom123"
protected val organizationInvalid = "loremipsom123"
protected val repoInvalid = "loremipsom123"
val wordBank = Array("Alpha", "Beta", "Gamma", "Delta", "Epsilon", "Zeta", "Theta", "Lambda", "Pi", "Sigma")
def generateRandomString: String =
wordBank(nextInt(10)) + " " + wordBank(nextInt(10)) + " " + wordBank(nextInt(10))
def generateRandomWord: String = wordBank(nextInt(10))
def generateRandomInt: Int = nextInt(1000)
}
object Constants {
private val token = sys.env("GITHUB_TOKEN")
implicit val client = new AsyncHttpClient()
val API = GitHubAPI(token)
}