Skip to content

Commit

Permalink
use ioJsonContentOf to fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
shinyhappydan committed Oct 18, 2023
1 parent b667f3e commit 1adf996
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -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}
Expand All @@ -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

Expand Down Expand Up @@ -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(_))
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 1adf996

Please sign in to comment.