blob: b2dc81f16d32bc98c21d7c41f36678580271f37c [file] [log] [blame]
package com.gerritforge.analytics
import com.gerritforge.analytics.model.GerritProjects
import org.scalatest.{FlatSpec, Matchers}
import scala.io.{Codec, Source}
class GerritProjectsSpec extends FlatSpec with Matchers {
"GerritProjects" should "parseProjects" in {
val projectNames = GerritProjects(Source.fromString(
""")]}'
|{
| "All-Projects": {
| "id": "All-Projects",
| "state": "ACTIVE"
| },
| "Test": {
| "id": "Test",
| "state": "ACTIVE"
| }
|}
|""".stripMargin))
projectNames should have size 2
projectNames should contain allOf("All-Projects", "Test")
}
}