mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 15:06:50 +00:00
test/(v5_0_0): add API root and banks endpoint tests
Add test scenarios for the GET /root and GET /banks endpoints in the v5.0.0 API to verify they return the expected API info and banks list structure.
This commit is contained in:
parent
a97c8d6ffb
commit
90ef73c863
@ -0,0 +1,33 @@
|
||||
package code.api.v5_0_0
|
||||
|
||||
import code.api.v4_0_0.{APIInfoJson400, BanksJson400}
|
||||
import com.openbankproject.commons.util.ApiVersion
|
||||
import org.scalatest.Tag
|
||||
|
||||
class RootAndBanksTest extends V500ServerSetup {
|
||||
|
||||
object VersionOfApi extends Tag(ApiVersion.v5_0_0.toString)
|
||||
|
||||
feature(s"V500 public read endpoints - $VersionOfApi") {
|
||||
|
||||
scenario("GET /root returns API info", VersionOfApi) {
|
||||
val request = (v5_0_0_Request / "root").GET
|
||||
val response = makeGetRequest(request)
|
||||
response.code should equal(200)
|
||||
val apiInfo = response.body.extract[APIInfoJson400]
|
||||
apiInfo.version.nonEmpty shouldBe true
|
||||
apiInfo.version_status.nonEmpty shouldBe true
|
||||
apiInfo.git_commit.nonEmpty shouldBe true
|
||||
apiInfo.connector.nonEmpty shouldBe true
|
||||
}
|
||||
|
||||
scenario("GET /banks returns banks list", VersionOfApi) {
|
||||
val request = (v5_0_0_Request / "banks").GET
|
||||
val response = makeGetRequest(request)
|
||||
response.code should equal(200)
|
||||
val banks = response.body.extract[BanksJson400]
|
||||
banks.banks.nonEmpty shouldBe true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user