From bd726ccfffdaaaaae10cec000bf2148e42fb562a Mon Sep 17 00:00:00 2001 From: dantb Date: Wed, 11 Oct 2023 23:01:29 +0200 Subject: [PATCH] Merge --- .../ResolverScopeInitialization.scala | 2 +- .../nexus/delta/sdk/resolvers/Resolvers.scala | 1 - .../sdk/resources/ValidateResource.scala | 1 - .../nexus/testkit/ce/CatsEffectSuite.scala | 6 +----- .../kg/CompositeViewsLifeCycleSpec.scala | 20 +++++++++---------- 5 files changed, 12 insertions(+), 18 deletions(-) diff --git a/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/resolvers/ResolverScopeInitialization.scala b/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/resolvers/ResolverScopeInitialization.scala index 54f414bb42..9ddea2fc95 100644 --- a/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/resolvers/ResolverScopeInitialization.scala +++ b/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/resolvers/ResolverScopeInitialization.scala @@ -40,7 +40,7 @@ class ResolverScopeInitialization(createResolver: CreateResolver, defaults: Defa case rej => val str = s"Failed to create the default InProject resolver for project '${project.ref}' due to '${rej.getMessage}'." - logger.error(str) >> IO.raiseError(ScopeInitializationFailed(str)) + logger.error(str) *> IO.raiseError(ScopeInitializationFailed(str)) } .span("createDefaultResolver") diff --git a/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/resolvers/Resolvers.scala b/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/resolvers/Resolvers.scala index 6b08e8a59a..8622c71e95 100644 --- a/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/resolvers/Resolvers.scala +++ b/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/resolvers/Resolvers.scala @@ -1,7 +1,6 @@ package ch.epfl.bluebrain.nexus.delta.sdk.resolvers import cats.effect.{Clock, IO} -import cats.syntax.all._ import ch.epfl.bluebrain.nexus.delta.kernel.effect.migration._ import ch.epfl.bluebrain.nexus.delta.kernel.search.Pagination.FromPagination import ch.epfl.bluebrain.nexus.delta.rdf.IriOrBNode.Iri diff --git a/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/resources/ValidateResource.scala b/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/resources/ValidateResource.scala index 50952afe8d..9fed0a9933 100644 --- a/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/resources/ValidateResource.scala +++ b/delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/resources/ValidateResource.scala @@ -4,7 +4,6 @@ import cats.implicits.catsSyntaxMonadError import ch.epfl.bluebrain.nexus.delta.kernel.effect.migration._ import ch.epfl.bluebrain.nexus.delta.rdf.IriOrBNode.Iri import cats.syntax.all._ -import ch.epfl.bluebrain.nexus.delta.kernel.effect.migration._ import ch.epfl.bluebrain.nexus.delta.rdf.Vocabulary.{contexts, schemas} import ch.epfl.bluebrain.nexus.delta.rdf.graph.Graph import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.ExpandedJsonLd diff --git a/delta/testkit/src/main/scala/ch/epfl/bluebrain/nexus/testkit/ce/CatsEffectSuite.scala b/delta/testkit/src/main/scala/ch/epfl/bluebrain/nexus/testkit/ce/CatsEffectSuite.scala index 2118e98dae..82e38fccad 100644 --- a/delta/testkit/src/main/scala/ch/epfl/bluebrain/nexus/testkit/ce/CatsEffectSuite.scala +++ b/delta/testkit/src/main/scala/ch/epfl/bluebrain/nexus/testkit/ce/CatsEffectSuite.scala @@ -19,11 +19,7 @@ abstract class CatsEffectSuite with StreamAssertions with CollectionAssertions with EitherAssertions { - protected val ioTimeout: FiniteDuration = 45.seconds - - implicit val contextShift: ContextShift[IO] = IO.contextShift(ExecutionContext.global) - implicit val timer: Timer[IO] = IO.timer(ExecutionContext.global) - + protected val ioTimeout: FiniteDuration = 45.seconds override def munitValueTransforms: List[ValueTransform] = super.munitValueTransforms ++ List(munitIOTransform, munitBIOTransform) diff --git a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/CompositeViewsLifeCycleSpec.scala b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/CompositeViewsLifeCycleSpec.scala index 3d559c6561..187bd3ba5a 100644 --- a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/CompositeViewsLifeCycleSpec.scala +++ b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/CompositeViewsLifeCycleSpec.scala @@ -3,7 +3,6 @@ package ch.epfl.bluebrain.nexus.tests.kg import cats.data.NonEmptyMap import cats.effect.IO import ch.epfl.bluebrain.nexus.delta.kernel.effect.migration._ -import cats.effect.IO import ch.epfl.bluebrain.nexus.tests.BaseSpec import ch.epfl.bluebrain.nexus.tests.Identity.compositeviews.Jerry import ch.epfl.bluebrain.nexus.tests.iam.types.Permission.{Events, Organizations, Views} @@ -16,6 +15,8 @@ import org.scalactic.source.Position final class CompositeViewsLifeCycleSpec extends BaseSpec { + implicit private val classLoader: ClassLoader = getClass.getClassLoader + private val orgId = genId() private val projId = genId() private val proj2Id = genId() @@ -42,15 +43,14 @@ final class CompositeViewsLifeCycleSpec extends BaseSpec { "proj" -> proj2Id, "query" -> query ) ++ includeCrossProjectOpt ++ includeSparqlProjectionOpt - IO( - ioJsonContentOf( - "/kg/views/composite/composite-view-lifecycle.json", - replacements( - Jerry, - values: _* - ): _* - ) + ioJsonContentOf( + "/kg/views/composite/composite-view-lifecycle.json", + replacements( + Jerry, + values: _* + ): _* ) + } private def fetchSpaces: Task[Spaces] = deltaClient.getJson[Spaces](s"$viewEndpoint/description", Jerry) @@ -71,7 +71,7 @@ final class CompositeViewsLifeCycleSpec extends BaseSpec { "handle correctly the expected spaces" in { for { // Creating the view - version1 <- (createView(query, includeCrossProject = true, includeSparqlProjection = true): Task[Json]) + version1 <- createView(query, includeCrossProject = true, includeSparqlProjection = true) _ <- deltaClient.put[Json](s"$viewEndpoint", version1, Jerry) { expectCreated } spaces1 <- fetchSpaces _ = includeAllSpaces(spaces1)