blob: 780461e05d0f55aa39dc5f6fe48c6cec7460f095 [file] [log] [blame]
package com.gerritforge.analytics.model
import org.scalatest.{FlatSpec, Matchers}
class GerritEndpointConfigTest extends FlatSpec with Matchers {
"gerritProjectsUrl" should "contain prefix when available" in {
val prefix = "prefixMustBeThere"
val conf = GerritEndpointConfig(baseUrl = "testBaseUrl", prefix = Some(prefix))
conf.gerritProjectsUrl shouldBe s"testBaseUrl/projects/?p=$prefix"
}
it should "not contain prefix when not available" in {
val conf = GerritEndpointConfig(baseUrl = "testBaseUrl", prefix = None)
conf.gerritProjectsUrl shouldBe s"testBaseUrl/projects/"
}
}