From 1adf996001ecd5df354890b6e7234b3b1a4df086 Mon Sep 17 00:00:00 2001 From: Daniel Bell Date: Wed, 18 Oct 2023 14:42:46 +0200 Subject: [PATCH] use ioJsonContentOf to fix test --- .../delta/sdk/resources/ResourcesTrialSuite.scala | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/resources/ResourcesTrialSuite.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/resources/ResourcesTrialSuite.scala index ff3f161b11..27e2d8e5a7 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/resources/ResourcesTrialSuite.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/resources/ResourcesTrialSuite.scala @@ -1,7 +1,6 @@ package ch.epfl.bluebrain.nexus.delta.sdk.resources import cats.effect.IO -import ch.epfl.bluebrain.nexus.delta.kernel.effect.migration._ import ch.epfl.bluebrain.nexus.delta.kernel.utils.UUIDF import ch.epfl.bluebrain.nexus.delta.rdf.Vocabulary.{contexts, nxv, schema} import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.api.{JsonLdApi, JsonLdJavaApi} @@ -21,6 +20,7 @@ import ch.epfl.bluebrain.nexus.delta.sourcing.model.ResourceRef.Revision import ch.epfl.bluebrain.nexus.testkit.TestHelpers import ch.epfl.bluebrain.nexus.testkit.ce.CatsEffectSuite import munit.Location +import ch.epfl.bluebrain.nexus.delta.kernel.effect.migration._ import java.util.UUID @@ -99,8 +99,9 @@ class ResourcesTrialSuite extends CatsEffectSuite with ValidateResourceFixture w ) val anotherSchema = nxv + "anotherSchema" - val schemaSource = jsonContentOf("resources/schema.json").addContext(contexts.shacl, contexts.schemasMetadata) for { + schemaSource <- + ioJsonContentOf("resources/schema.json").map(_.addContext(contexts.shacl, contexts.schemasMetadata)).toCatsIO schema <- SchemaGen .schemaAsync(anotherSchema, project.ref, schemaSource.removeKeys(keywords.id)) .map(SchemaGen.resourceFor(_)) @@ -132,7 +133,7 @@ class ResourcesTrialSuite extends CatsEffectSuite with ValidateResourceFixture w .resourceAsync(id, projectRef, source.value, Revision(resourceSchema, 1)) .map(ResourceGen.resourceFor(_)) trial = ResourcesTrial( - (_, _) => IO.pure(resource).toUIO, + (_, _) => IO.pure(resource), alwaysValidate, fetchContext, resolverContextResolution @@ -149,7 +150,7 @@ class ResourcesTrialSuite extends CatsEffectSuite with ValidateResourceFixture w .resourceAsync(id, projectRef, source.value, Revision(resourceSchema, 1)) .map(ResourceGen.resourceFor(_)) trial = ResourcesTrial( - (_, _) => IO.pure(resource).toUIO, + (_, _) => IO.pure(resource), alwaysValidate, fetchContext, resolverContextResolution @@ -169,7 +170,7 @@ class ResourcesTrialSuite extends CatsEffectSuite with ValidateResourceFixture w expectedError = InvalidResource(id, Revision(anotherSchema, defaultSchemaRevision), defaultReport, resource.value.expanded) trial = ResourcesTrial( - (_, _) => IO.pure(resource).toUIO, + (_, _) => IO.pure(resource), alwaysFail(expectedError), fetchContext, resolverContextResolution