From d08a83c68e2d854e55d645285c5fe80fa9d3457a Mon Sep 17 00:00:00 2001 From: Jakub Chrobasik Date: Fri, 11 Aug 2023 11:53:48 +0200 Subject: [PATCH] feat: Renku Core Client --- .../renku/core/client/RenkuCoreClientSpec.scala | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/renku-core-client/src/test/scala/io/renku/core/client/RenkuCoreClientSpec.scala b/renku-core-client/src/test/scala/io/renku/core/client/RenkuCoreClientSpec.scala index ec1112fac8..392df2bdfd 100644 --- a/renku-core-client/src/test/scala/io/renku/core/client/RenkuCoreClientSpec.scala +++ b/renku-core-client/src/test/scala/io/renku/core/client/RenkuCoreClientSpec.scala @@ -19,10 +19,13 @@ package io.renku.core.client import cats.effect.IO +import io.renku.generators.Generators.Implicits._ +import io.renku.graph.model.GraphModelGenerators.{projectSchemaVersions, projectSlugs} import io.renku.interpreters.TestLogger import io.renku.stubbing.ExternalServiceStubbing import io.renku.testtools.CustomAsyncIOSpec import org.scalamock.scalatest.AsyncMockFactory +import com.github.tomakehurst.wiremock.client.WireMock._ import org.scalatest.matchers.should import org.scalatest.wordspec.AsyncWordSpec import org.scalatest.{EitherValues, OptionValues} @@ -37,6 +40,20 @@ class RenkuCoreClientSpec with ExternalServiceStubbing with AsyncMockFactory { + "getMigrationCheck" should { + + "return info about current project schema version" in { + + val schemaVersion = projectSchemaVersions.generateOne + val projectSlug = projectSlugs.generateOne + + stubFor { + get(s"/renku/cache.migrations_check").withQueryParam("git_url", ) + .willReturn(ok(Result.success(versionTuples).asJson.spaces2)) + } + } + } + private implicit val logger: Logger[IO] = TestLogger() private val coreVersionClient = mock[RenkuCoreVersionClient[IO]] private lazy val client = new RenkuCoreClientImpl[IO](RenkuCoreUri.Current(externalServiceBaseUri), coreVersionClient)