diff --git a/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/config/AppConfigSpec.scala b/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/config/AppConfigSpec.scala index 8cf9c65a4d..acef0dbbf9 100644 --- a/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/config/AppConfigSpec.scala +++ b/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/config/AppConfigSpec.scala @@ -1,13 +1,11 @@ package ch.epfl.bluebrain.nexus.delta.config import ch.epfl.bluebrain.nexus.delta.kernel.utils.ClasspathResourceUtils -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import com.typesafe.config.impl.ConfigImpl import org.scalatest.BeforeAndAfterAll -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike -class AppConfigSpec extends AnyWordSpecLike with Matchers with BIOValues with BeforeAndAfterAll { +class AppConfigSpec extends BioSpec with BeforeAndAfterAll { implicit private val classLoader: ClassLoader = getClass.getClassLoader diff --git a/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/dependency/PostgresServiceDependencySpec.scala b/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/dependency/PostgresServiceDependencySpec.scala index 96a59f60f7..3cfd6e3eec 100644 --- a/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/dependency/PostgresServiceDependencySpec.scala +++ b/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/dependency/PostgresServiceDependencySpec.scala @@ -3,10 +3,9 @@ package ch.epfl.bluebrain.nexus.delta.dependency import ch.epfl.bluebrain.nexus.delta.sdk.model.ComponentDescription.ServiceDescription import ch.epfl.bluebrain.nexus.delta.sdk.model.Name import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.{DoobieScalaTestFixture, PostgresDocker} -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues -import org.scalatest.matchers.should.Matchers +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec -class PostgresServiceDependencySpec extends DoobieScalaTestFixture with Matchers with PostgresDocker with BIOValues { +class PostgresServiceDependencySpec extends BioSpec with DoobieScalaTestFixture with PostgresDocker { "PostgresServiceDependency" should { diff --git a/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugin/PluginClassLoaderSpec.scala b/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugin/PluginClassLoaderSpec.scala index 4435738322..11f9264eb6 100644 --- a/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugin/PluginClassLoaderSpec.scala +++ b/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugin/PluginClassLoaderSpec.scala @@ -1,16 +1,14 @@ package ch.epfl.bluebrain.nexus.delta.plugin import ch.epfl.bluebrain.nexus.delta.testplugin.ClassLoaderTestClassImpl -import ch.epfl.bluebrain.nexus.testkit.scalatest.ShouldMatchers.convertToAnyShouldWrapper import ch.epfl.bluebrain.nexus.testkit.plugin.ClassLoaderTestClass +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec import org.scalatest.BeforeAndAfterAll -import org.scalatest.matchers.must.Matchers -import org.scalatest.wordspec.AnyWordSpecLike import java.nio.file.Path import scala.io.Source -class PluginClassLoaderSpec extends AnyWordSpecLike with Matchers with BeforeAndAfterAll { +class PluginClassLoaderSpec extends BaseSpec with BeforeAndAfterAll { val jarPath = Path.of("../plugins/test-plugin/target/delta-test-plugin.jar") val cl = new PluginClassLoader( diff --git a/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugin/PluginLoaderSpec.scala b/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugin/PluginLoaderSpec.scala index 0b868afb16..e263635a67 100644 --- a/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugin/PluginLoaderSpec.scala +++ b/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugin/PluginLoaderSpec.scala @@ -1,23 +1,19 @@ package ch.epfl.bluebrain.nexus.delta.plugin import akka.http.scaladsl.testkit.ScalatestRouteTest -import cats.effect.{ContextShift, IO, Timer} +import ch.epfl.bluebrain.nexus.delta.kernel.effect.migration._ import ch.epfl.bluebrain.nexus.delta.plugin.PluginsLoader.PluginLoaderConfig import ch.epfl.bluebrain.nexus.delta.sdk.PriorityRoute import ch.epfl.bluebrain.nexus.delta.sdk.model.BaseUri +import ch.epfl.bluebrain.nexus.testkit.ce.CatsRunContext +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import com.typesafe.config.impl.ConfigImpl import izumi.distage.model.definition.ModuleDef import monix.bio.Task -import ch.epfl.bluebrain.nexus.delta.kernel.effect.migration._ -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues import monix.execution.Scheduler import monix.execution.Scheduler.Implicits.global -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike -import scala.concurrent.ExecutionContext - -class PluginLoaderSpec extends AnyWordSpecLike with ScalatestRouteTest with Matchers with BIOValues { +class PluginLoaderSpec extends BioSpec with ScalatestRouteTest with CatsRunContext { private val baseUri = BaseUri.withoutPrefix("http://localhost") private val serviceModule = new ModuleDef { @@ -25,9 +21,6 @@ class PluginLoaderSpec extends AnyWordSpecLike with ScalatestRouteTest with Matc make[Scheduler].from(Scheduler.global) } - implicit val contextShift: ContextShift[IO] = IO.contextShift(ExecutionContext.global) - implicit val timer: Timer[IO] = IO.timer(ExecutionContext.global) - "A PluginLoader" should { val config = PluginLoaderConfig("../plugins/test-plugin/target") "load plugins from .jar in a directory" in { diff --git a/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/routes/AclsRoutesPayloadSpec.scala b/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/routes/AclsRoutesPayloadSpec.scala index 7da6652bfe..bc860825f1 100644 --- a/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/routes/AclsRoutesPayloadSpec.scala +++ b/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/routes/AclsRoutesPayloadSpec.scala @@ -5,11 +5,9 @@ import ch.epfl.bluebrain.nexus.delta.routes.AclsRoutes.{AclValues, PatchAcl, Rep import ch.epfl.bluebrain.nexus.delta.sdk.permissions.Permissions.resources import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity import ch.epfl.bluebrain.nexus.testkit.CirceLiteral -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec -class AclsRoutesPayloadSpec extends AnyWordSpecLike with Matchers with CirceLiteral with EitherValues { +class AclsRoutesPayloadSpec extends BaseSpec with CirceLiteral { private val json = json"""{"acl": [{"permissions": ["resources/read"], "identity": {"@type": "Anonymous"} } ] }""" diff --git a/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/routes/OrganizationsRoutesSpec.scala b/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/routes/OrganizationsRoutesSpec.scala index 011b1c9c60..145532c5e7 100644 --- a/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/routes/OrganizationsRoutesSpec.scala +++ b/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/routes/OrganizationsRoutesSpec.scala @@ -14,20 +14,19 @@ import ch.epfl.bluebrain.nexus.delta.sdk.generators.OrganizationGen import ch.epfl.bluebrain.nexus.delta.sdk.identities.IdentitiesDummy import ch.epfl.bluebrain.nexus.delta.sdk.identities.model.Caller import ch.epfl.bluebrain.nexus.delta.sdk.implicits._ -import ch.epfl.bluebrain.nexus.delta.sdk.organizations.{OrganizationDeleter, OrganizationsConfig, OrganizationsImpl} import ch.epfl.bluebrain.nexus.delta.sdk.organizations.model.OrganizationRejection.OrganizationNonEmpty +import ch.epfl.bluebrain.nexus.delta.sdk.organizations.{OrganizationDeleter, OrganizationsConfig, OrganizationsImpl} import ch.epfl.bluebrain.nexus.delta.sdk.permissions.Permissions.{events, orgs => orgsPermissions} import ch.epfl.bluebrain.nexus.delta.sdk.projects.OwnerPermissionsScopeInitialization import ch.epfl.bluebrain.nexus.delta.sdk.utils.BaseRouteSpec import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Anonymous, Authenticated, Group, Subject} import ch.epfl.bluebrain.nexus.delta.sourcing.model.Label import ch.epfl.bluebrain.nexus.testkit.bio.IOFromMap -import ch.epfl.bluebrain.nexus.testkit.ce.IOFixedClock import io.circe.Json import java.util.UUID -class OrganizationsRoutesSpec extends BaseRouteSpec with IOFromMap with IOFixedClock { +class OrganizationsRoutesSpec extends BaseRouteSpec with IOFromMap { private val fixedUuid = UUID.randomUUID() implicit private val uuidF: UUIDF = UUIDF.fixed(fixedUuid) diff --git a/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/routes/PermissionsRoutesSpec.scala b/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/routes/PermissionsRoutesSpec.scala index f0c3aa3dda..19826c533f 100644 --- a/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/routes/PermissionsRoutesSpec.scala +++ b/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/routes/PermissionsRoutesSpec.scala @@ -15,11 +15,10 @@ import ch.epfl.bluebrain.nexus.delta.sdk.permissions.{Permissions, PermissionsCo import ch.epfl.bluebrain.nexus.delta.sdk.utils.BaseRouteSpec import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Anonymous, Subject} -import ch.epfl.bluebrain.nexus.testkit.ce.IOFixedClock import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsIOValues import io.circe.Json -class PermissionsRoutesSpec extends BaseRouteSpec with IOFixedClock with CatsIOValues { +class PermissionsRoutesSpec extends BaseRouteSpec with CatsIOValues { implicit private val caller: Subject = Identity.Anonymous diff --git a/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/routes/RealmsRoutesSpec.scala b/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/routes/RealmsRoutesSpec.scala index 39576f1d37..32835763d7 100644 --- a/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/routes/RealmsRoutesSpec.scala +++ b/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/routes/RealmsRoutesSpec.scala @@ -18,10 +18,10 @@ import ch.epfl.bluebrain.nexus.delta.sdk.realms.{RealmsConfig, RealmsImpl} import ch.epfl.bluebrain.nexus.delta.sdk.utils.BaseRouteSpec import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Anonymous, Authenticated, Group, Subject} import ch.epfl.bluebrain.nexus.delta.sourcing.model.Label -import ch.epfl.bluebrain.nexus.testkit.ce.{IOFixedClock, IOFromMap} +import ch.epfl.bluebrain.nexus.testkit.ce.IOFromMap import io.circe.Json -class RealmsRoutesSpec extends BaseRouteSpec with IOFromMap with IOFixedClock { +class RealmsRoutesSpec extends BaseRouteSpec with IOFromMap { val (github, gitlab) = (Label.unsafe("github"), Label.unsafe("gitlab")) val (githubName, gitlabName) = (Name.unsafe("github-name"), Name.unsafe("gitlab-name")) diff --git a/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/routes/ResolversRoutesSpec.scala b/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/routes/ResolversRoutesSpec.scala index 3862673d7d..df6ffc60bf 100644 --- a/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/routes/ResolversRoutesSpec.scala +++ b/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/routes/ResolversRoutesSpec.scala @@ -31,14 +31,13 @@ import ch.epfl.bluebrain.nexus.delta.sdk.{Defaults, IndexingAction} import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Anonymous, Authenticated, Group, Subject} import ch.epfl.bluebrain.nexus.delta.sourcing.model.ResourceRef.{Latest, Revision} import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef, ResourceRef} -import ch.epfl.bluebrain.nexus.testkit.ce.IOFixedClock import io.circe.Json import io.circe.syntax._ import java.util.UUID import java.util.concurrent.atomic.AtomicInteger -class ResolversRoutesSpec extends BaseRouteSpec with IOFixedClock { +class ResolversRoutesSpec extends BaseRouteSpec { private val uuid = UUID.randomUUID() implicit private val uuidF: UUIDF = UUIDF.fixed(uuid) diff --git a/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/routes/ResourcesRoutesSpec.scala b/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/routes/ResourcesRoutesSpec.scala index fe8100c098..d8f3c66005 100644 --- a/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/routes/ResourcesRoutesSpec.scala +++ b/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/routes/ResourcesRoutesSpec.scala @@ -32,13 +32,12 @@ import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Anonymous, Authent import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag import ch.epfl.bluebrain.nexus.delta.sourcing.model.{ProjectRef, ResourceRef} import ch.epfl.bluebrain.nexus.testkit.bio.IOFromMap -import ch.epfl.bluebrain.nexus.testkit.ce.IOFixedClock import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsIOValues import io.circe.{Json, Printer} import java.util.UUID -class ResourcesRoutesSpec extends BaseRouteSpec with IOFromMap with IOFixedClock with CatsIOValues { +class ResourcesRoutesSpec extends BaseRouteSpec with IOFromMap with CatsIOValues { private val uuid = UUID.randomUUID() implicit private val uuidF: UUIDF = UUIDF.fixed(uuid) diff --git a/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/routes/SchemasRoutesSpec.scala b/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/routes/SchemasRoutesSpec.scala index fb8cdd6778..e37f4d8eeb 100644 --- a/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/routes/SchemasRoutesSpec.scala +++ b/delta/app/src/test/scala/ch/epfl/bluebrain/nexus/delta/routes/SchemasRoutesSpec.scala @@ -28,12 +28,11 @@ import ch.epfl.bluebrain.nexus.delta.sdk.utils.BaseRouteSpec import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Anonymous, Authenticated, Group, Subject} import ch.epfl.bluebrain.nexus.delta.sourcing.model.ProjectRef import ch.epfl.bluebrain.nexus.testkit.bio.IOFromMap -import ch.epfl.bluebrain.nexus.testkit.ce.IOFixedClock import io.circe.Json import java.util.UUID -class SchemasRoutesSpec extends BaseRouteSpec with IOFixedClock with IOFromMap { +class SchemasRoutesSpec extends BaseRouteSpec with IOFromMap { private val uuid = UUID.randomUUID() implicit private val uuidF: UUIDF = UUIDF.fixed(uuid) diff --git a/delta/plugins/archive/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/ArchiveRoutesSpec.scala b/delta/plugins/archive/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/ArchiveRoutesSpec.scala index 7f5721afbf..bb4f80eb8f 100644 --- a/delta/plugins/archive/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/ArchiveRoutesSpec.scala +++ b/delta/plugins/archive/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/ArchiveRoutesSpec.scala @@ -47,7 +47,6 @@ import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.Subject import ch.epfl.bluebrain.nexus.delta.sourcing.model.ResourceRef.Latest import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Identity, Label, ProjectRef, ResourceRef} import ch.epfl.bluebrain.nexus.testkit.archive.ArchiveHelpers -import ch.epfl.bluebrain.nexus.testkit.ce.IOFixedClock import io.circe.Json import io.circe.syntax.EncoderOps import org.scalatest.TryValues @@ -55,12 +54,7 @@ import org.scalatest.TryValues import java.util.UUID import scala.concurrent.duration._ -class ArchiveRoutesSpec - extends BaseRouteSpec - with StorageFixtures - with IOFixedClock - with TryValues - with ArchiveHelpers { +class ArchiveRoutesSpec extends BaseRouteSpec with StorageFixtures with TryValues with ArchiveHelpers { private val uuid = UUID.fromString("8249ba90-7cc6-4de5-93a1-802c04200dcc") implicit private val uuidF: StatefulUUIDF = UUIDF.stateful(uuid).accepted diff --git a/delta/plugins/archive/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/ArchivesDecodingSpec.scala b/delta/plugins/archive/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/ArchivesDecodingSpec.scala index a1b6fd4ff7..1d675177eb 100644 --- a/delta/plugins/archive/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/ArchivesDecodingSpec.scala +++ b/delta/plugins/archive/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/ArchivesDecodingSpec.scala @@ -4,33 +4,21 @@ import cats.data.NonEmptySet import ch.epfl.bluebrain.nexus.delta.kernel.utils.UUIDF import ch.epfl.bluebrain.nexus.delta.plugins.archive.model.ArchiveReference.{FileReference, ResourceReference} import ch.epfl.bluebrain.nexus.delta.plugins.archive.model.ArchiveRejection.{DecodingFailed, InvalidJsonLdFormat, UnexpectedArchiveId} -import ch.epfl.bluebrain.nexus.delta.sdk.model.ResourceRepresentation.{AnnotatedSourceJson, CompactedJsonLd, Dot, ExpandedJsonLd, NTriples, SourceJson} import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.model.AbsolutePath import ch.epfl.bluebrain.nexus.delta.rdf.Vocabulary.nxv import ch.epfl.bluebrain.nexus.delta.rdf.implicits._ import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.api.{JsonLdApi, JsonLdJavaApi} +import ch.epfl.bluebrain.nexus.delta.sdk.model.ResourceRepresentation.{AnnotatedSourceJson, CompactedJsonLd, Dot, ExpandedJsonLd, NTriples, SourceJson} import ch.epfl.bluebrain.nexus.delta.sdk.projects.model.{ApiMappings, ProjectContext} import ch.epfl.bluebrain.nexus.delta.sourcing.model.ProjectRef import ch.epfl.bluebrain.nexus.delta.sourcing.model.ResourceRef.{Latest, Revision, Tag} import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues -import ch.epfl.bluebrain.nexus.testkit.TestHelpers -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import io.circe.literal._ -import org.scalatest.Inspectors -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike import java.nio.file.Paths -class ArchivesDecodingSpec - extends AnyWordSpecLike - with Matchers - with Inspectors - with BIOValues - with EitherValues - with TestHelpers - with RemoteContextResolutionFixture { +class ArchivesDecodingSpec extends BioSpec with RemoteContextResolutionFixture { implicit private val uuidF: UUIDF = UUIDF.random implicit private val api: JsonLdApi = JsonLdJavaApi.strict diff --git a/delta/plugins/archive/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/ArchivesSTMSpec.scala b/delta/plugins/archive/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/ArchivesSTMSpec.scala index f890d2c36c..7b147c6274 100644 --- a/delta/plugins/archive/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/ArchivesSTMSpec.scala +++ b/delta/plugins/archive/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/ArchivesSTMSpec.scala @@ -8,23 +8,12 @@ import ch.epfl.bluebrain.nexus.delta.sdk.model.ResourceRepresentation.SourceJson import ch.epfl.bluebrain.nexus.delta.sdk.syntax._ import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.User import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef, ResourceRef} -import ch.epfl.bluebrain.nexus.testkit.ce.IOFixedClock -import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsIOValues -import ch.epfl.bluebrain.nexus.testkit.TestHelpers -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike +import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsEffectSpec import java.nio.file.Paths import java.time.Instant -class ArchivesSTMSpec - extends AnyWordSpecLike - with Matchers - with CatsIOValues - with IOFixedClock - with EitherValues - with TestHelpers { +class ArchivesSTMSpec extends CatsEffectSpec { "An Archive STM" when { val id = iri"http://localhost${genString()}" diff --git a/delta/plugins/archive/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/ArchivesSpec.scala b/delta/plugins/archive/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/ArchivesSpec.scala index b6a0fc8f3c..9d9d690bc9 100644 --- a/delta/plugins/archive/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/ArchivesSpec.scala +++ b/delta/plugins/archive/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/archive/ArchivesSpec.scala @@ -22,12 +22,8 @@ import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Subject, User} import ch.epfl.bluebrain.nexus.delta.sourcing.model.ResourceRef.Latest import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef} import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.DoobieScalaTestFixture -import ch.epfl.bluebrain.nexus.testkit.TestHelpers -import ch.epfl.bluebrain.nexus.testkit.ce.{CatsRunContext, IOFixedClock} -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues -import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsIOValues +import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsEffectSpec import io.circe.literal._ -import org.scalatest.matchers.should.Matchers import java.net.URLEncoder import java.nio.charset.StandardCharsets @@ -35,15 +31,7 @@ import java.time.Instant import java.util.UUID import scala.concurrent.duration._ -class ArchivesSpec - extends DoobieScalaTestFixture - with Matchers - with IOFixedClock - with CatsRunContext - with CatsIOValues - with EitherValues - with TestHelpers - with RemoteContextResolutionFixture { +class ArchivesSpec extends CatsEffectSpec with DoobieScalaTestFixture with RemoteContextResolutionFixture { private val uuid = UUID.randomUUID() implicit private val uuidF: UUIDF = UUIDF.random diff --git a/delta/plugins/blazegraph/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/BlazegraphScopeInitializationSpec.scala b/delta/plugins/blazegraph/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/BlazegraphScopeInitializationSpec.scala index b783d15a35..ac8e763192 100644 --- a/delta/plugins/blazegraph/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/BlazegraphScopeInitializationSpec.scala +++ b/delta/plugins/blazegraph/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/BlazegraphScopeInitializationSpec.scala @@ -14,23 +14,15 @@ import ch.epfl.bluebrain.nexus.delta.sdk.{ConfigFixtures, Defaults} import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Subject, User} import ch.epfl.bluebrain.nexus.delta.sourcing.model.Label import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.DoobieScalaTestFixture -import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsIOValues -import ch.epfl.bluebrain.nexus.testkit.TestHelpers -import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock +import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsEffectSpec import monix.bio.UIO import monix.execution.Scheduler -import org.scalatest.Inspectors -import org.scalatest.matchers.should.Matchers import java.util.UUID class BlazegraphScopeInitializationSpec - extends DoobieScalaTestFixture - with Matchers - with Inspectors - with IOFixedClock - with CatsIOValues - with TestHelpers + extends CatsEffectSpec + with DoobieScalaTestFixture with ConfigFixtures with Fixtures { diff --git a/delta/plugins/blazegraph/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/BlazegraphViewDecodingSpec.scala b/delta/plugins/blazegraph/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/BlazegraphViewDecodingSpec.scala index 09a29bb5e7..2c0d240351 100644 --- a/delta/plugins/blazegraph/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/BlazegraphViewDecodingSpec.scala +++ b/delta/plugins/blazegraph/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/BlazegraphViewDecodingSpec.scala @@ -14,22 +14,12 @@ import ch.epfl.bluebrain.nexus.delta.sdk.projects.model.{ApiMappings, ProjectCon import ch.epfl.bluebrain.nexus.delta.sdk.views.ViewRef import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef} -import ch.epfl.bluebrain.nexus.testkit.TestHelpers -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import io.circe.literal._ -import org.scalatest.Inspectors -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike import java.util.UUID -class BlazegraphViewDecodingSpec - extends AnyWordSpecLike - with Matchers - with Inspectors - with BIOValues - with TestHelpers - with Fixtures { +class BlazegraphViewDecodingSpec extends BioSpec with Fixtures { private val context = ProjectContext.unsafe( ApiMappings.empty, diff --git a/delta/plugins/blazegraph/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/BlazegraphViewsSpec.scala b/delta/plugins/blazegraph/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/BlazegraphViewsSpec.scala index aa5d175f1f..47323e2a3a 100644 --- a/delta/plugins/blazegraph/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/BlazegraphViewsSpec.scala +++ b/delta/plugins/blazegraph/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/BlazegraphViewsSpec.scala @@ -21,27 +21,15 @@ import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Authenticated, Gro import ch.epfl.bluebrain.nexus.delta.sourcing.model.Label import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.DoobieScalaTestFixture -import ch.epfl.bluebrain.nexus.testkit._ -import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import io.circe.Json import io.circe.syntax._ import monix.bio.UIO import monix.execution.Scheduler -import org.scalatest.Inspectors -import org.scalatest.matchers.should.Matchers import java.util.UUID -class BlazegraphViewsSpec - extends DoobieScalaTestFixture - with Matchers - with Inspectors - with IOFixedClock - with BIOValues - with TestHelpers - with ConfigFixtures - with Fixtures { +class BlazegraphViewsSpec extends BioSpec with DoobieScalaTestFixture with ConfigFixtures with Fixtures { "BlazegraphViews" when { val uuid = UUID.randomUUID() diff --git a/delta/plugins/blazegraph/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/BlazegraphViewsStmSpec.scala b/delta/plugins/blazegraph/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/BlazegraphViewsStmSpec.scala index 3d5adc6da8..547bcd7fcf 100644 --- a/delta/plugins/blazegraph/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/BlazegraphViewsStmSpec.scala +++ b/delta/plugins/blazegraph/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/BlazegraphViewsStmSpec.scala @@ -17,25 +17,14 @@ import ch.epfl.bluebrain.nexus.delta.sdk.views.ViewRef import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Anonymous, Subject, User} import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef} -import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import io.circe.Json import monix.bio.IO -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike -import org.scalatest.{Inspectors, OptionValues} import java.time.Instant import java.util.UUID -class BlazegraphViewsStmSpec - extends AnyWordSpecLike - with Matchers - with Inspectors - with OptionValues - with IOFixedClock - with BIOValues - with Fixtures { +class BlazegraphViewsStmSpec extends BioSpec with Fixtures { "A Blazegraph STM" when { diff --git a/delta/plugins/blazegraph/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/routes/BlazegraphViewsQuerySpec.scala b/delta/plugins/blazegraph/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/routes/BlazegraphViewsQuerySpec.scala index 016f272ec0..0d2c19ecdc 100644 --- a/delta/plugins/blazegraph/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/routes/BlazegraphViewsQuerySpec.scala +++ b/delta/plugins/blazegraph/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/routes/BlazegraphViewsQuerySpec.scala @@ -46,6 +46,7 @@ import monix.bio.IO import monix.execution.Scheduler import org.scalatest.concurrent.Eventually import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike import org.scalatest.{CancelAfterFailure, DoNotDiscover, Inspectors, OptionValues} import java.time.Instant @@ -54,6 +55,7 @@ import scala.concurrent.duration._ @DoNotDiscover class BlazegraphViewsQuerySpec(docker: BlazegraphDocker) extends TestKit(ActorSystem("BlazegraphViewsQuerySpec")) + with AnyWordSpecLike with DoobieScalaTestFixture with Matchers with EitherValues diff --git a/delta/plugins/blazegraph/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/slowqueries/BlazegraphSlowQueryStoreSuite.scala b/delta/plugins/blazegraph/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/slowqueries/BlazegraphSlowQueryStoreSuite.scala index f28b675f69..401a28b3fc 100644 --- a/delta/plugins/blazegraph/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/slowqueries/BlazegraphSlowQueryStoreSuite.scala +++ b/delta/plugins/blazegraph/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/blazegraph/slowqueries/BlazegraphSlowQueryStoreSuite.scala @@ -7,7 +7,6 @@ import ch.epfl.bluebrain.nexus.delta.rdf.query.SparqlQuery import ch.epfl.bluebrain.nexus.delta.sdk.views.ViewRef import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Identity, Label, ProjectRef} import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.Doobie -import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock import ch.epfl.bluebrain.nexus.testkit.mu.bio.BioSuite import munit.AnyFixture @@ -17,7 +16,6 @@ import scala.concurrent.duration.DurationInt class BlazegraphSlowQueryStoreSuite extends BioSuite - with IOFixedClock with Doobie.Fixture with Doobie.Assertions with BlazegraphSlowQueryStoreFixture { diff --git a/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/BlazegraphQuerySpec.scala b/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/BlazegraphQuerySpec.scala index f99d86723b..ce6fed9fbb 100644 --- a/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/BlazegraphQuerySpec.scala +++ b/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/BlazegraphQuerySpec.scala @@ -16,7 +16,6 @@ import ch.epfl.bluebrain.nexus.delta.rdf.IriOrBNode.{BNode, Iri} import ch.epfl.bluebrain.nexus.delta.rdf.Vocabulary.nxv import ch.epfl.bluebrain.nexus.delta.rdf.graph.NTriples import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.context.ContextValue.ContextObject -import ch.epfl.bluebrain.nexus.delta.sdk.ConfigFixtures import ch.epfl.bluebrain.nexus.delta.sdk.acls.AclSimpleCheck import ch.epfl.bluebrain.nexus.delta.sdk.acls.model.AclAddress import ch.epfl.bluebrain.nexus.delta.sdk.generators.ProjectGen @@ -27,34 +26,14 @@ import ch.epfl.bluebrain.nexus.delta.sdk.permissions.model.Permission import ch.epfl.bluebrain.nexus.delta.sdk.views.{IndexingRev, ViewRef} import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Anonymous, Group, User} import ch.epfl.bluebrain.nexus.delta.sourcing.model.Label -import ch.epfl.bluebrain.nexus.testkit._ -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues -import ch.epfl.bluebrain.nexus.testkit.scalatest.{EitherValues, TestMatchers} +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import io.circe.JsonObject import monix.execution.Scheduler -import org.scalatest.concurrent.Eventually -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike -import org.scalatest.{CancelAfterFailure, Inspectors} +import org.scalatest.CancelAfterFailure import java.util.UUID -import scala.concurrent.duration._ - -class BlazegraphQuerySpec - extends AnyWordSpecLike - with Matchers - with EitherValues - with CirceLiteral - with TestHelpers - with TestMatchers - with CirceEq - with CancelAfterFailure - with Inspectors - with ConfigFixtures - with Fixtures - with BIOValues - with Eventually { - implicit override def patienceConfig: PatienceConfig = PatienceConfig(6.seconds, 100.millis) + +class BlazegraphQuerySpec extends BioSpec with CancelAfterFailure { implicit private val sc: Scheduler = Scheduler.global implicit val baseUri: BaseUri = BaseUri("http://localhost", Label.unsafe("v1")) diff --git a/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/CompositeViewDecodingSpec.scala b/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/CompositeViewDecodingSpec.scala index 5518526bdf..e488565e4b 100644 --- a/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/CompositeViewDecodingSpec.scala +++ b/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/CompositeViewDecodingSpec.scala @@ -19,13 +19,13 @@ import ch.epfl.bluebrain.nexus.delta.sdk.projects.model.{ApiMappings, ProjectCon import ch.epfl.bluebrain.nexus.delta.sdk.resolvers.ResolverContextResolution import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Group, User} import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef} +import ch.epfl.bluebrain.nexus.testkit.CirceLiteral import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec -import ch.epfl.bluebrain.nexus.testkit.{CirceLiteral, TestHelpers} import java.util.UUID import scala.concurrent.duration.DurationInt -class CompositeViewDecodingSpec extends BioSpec with TestHelpers with CirceLiteral with Fixtures { +class CompositeViewDecodingSpec extends BioSpec with CirceLiteral with Fixtures { private val realm = Label.unsafe("myrealm") implicit private val alice: Caller = Caller(User("Alice", realm), Set(User("Alice", realm), Group("users", realm))) diff --git a/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/CompositeViewsSpec.scala b/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/CompositeViewsSpec.scala index 2347296a20..1bf4d92672 100644 --- a/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/CompositeViewsSpec.scala +++ b/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/CompositeViewsSpec.scala @@ -17,21 +17,16 @@ import ch.epfl.bluebrain.nexus.delta.sourcing.model.Label import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.DoobieScalaTestFixture import ch.epfl.bluebrain.nexus.testkit.CirceEq -import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import io.circe.Json import io.circe.syntax._ import monix.execution.Scheduler -import org.scalatest.matchers.should.Matchers -import org.scalatest.{Inspectors, OptionValues} import java.time.Instant class CompositeViewsSpec - extends DoobieScalaTestFixture - with Matchers - with Inspectors - with IOFixedClock - with OptionValues + extends BioSpec + with DoobieScalaTestFixture with CompositeViewsFixture with CirceEq with Fixtures { diff --git a/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/CompositeViewsStmSpec.scala b/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/CompositeViewsStmSpec.scala index f1cbcc1de9..8431d39f27 100644 --- a/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/CompositeViewsStmSpec.scala +++ b/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/CompositeViewsStmSpec.scala @@ -10,27 +10,14 @@ import ch.epfl.bluebrain.nexus.delta.sdk.model.Tags import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Anonymous, Subject} import ch.epfl.bluebrain.nexus.delta.sourcing.model.ProjectRef import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues -import ch.epfl.bluebrain.nexus.testkit.TestHelpers -import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import io.circe.Json import monix.bio.IO -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike -import org.scalatest.{Inspectors, OptionValues} import java.time.Instant import java.util.UUID -class CompositeViewsStmSpec - extends AnyWordSpecLike - with Matchers - with Inspectors - with IOFixedClock - with OptionValues - with BIOValues - with TestHelpers - with CompositeViewsFixture { +class CompositeViewsStmSpec extends BioSpec with CompositeViewsFixture { "A CompositeViews STM" when { val validView: ValidateCompositeView = (_, _) => IO.unit diff --git a/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/ElasticSearchQuerySpec.scala b/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/ElasticSearchQuerySpec.scala index 1115dc729a..cb004b5b44 100644 --- a/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/ElasticSearchQuerySpec.scala +++ b/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/ElasticSearchQuerySpec.scala @@ -15,7 +15,6 @@ import ch.epfl.bluebrain.nexus.delta.plugins.compositeviews.test.{expandOnlyIris import ch.epfl.bluebrain.nexus.delta.rdf.IriOrBNode.Iri import ch.epfl.bluebrain.nexus.delta.rdf.Vocabulary.nxv import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.context.ContextValue.ContextObject -import ch.epfl.bluebrain.nexus.delta.sdk.ConfigFixtures import ch.epfl.bluebrain.nexus.delta.sdk.acls.AclSimpleCheck import ch.epfl.bluebrain.nexus.delta.sdk.acls.model.AclAddress import ch.epfl.bluebrain.nexus.delta.sdk.generators.ProjectGen @@ -29,36 +28,17 @@ import ch.epfl.bluebrain.nexus.delta.sdk.views.{IndexingRev, ViewRef} import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Anonymous, Group, User} import ch.epfl.bluebrain.nexus.delta.sourcing.model.Label import ch.epfl.bluebrain.nexus.testkit._ -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues -import ch.epfl.bluebrain.nexus.testkit.scalatest.{EitherValues, TestMatchers} +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import io.circe.syntax._ import io.circe.{Json, JsonObject} import monix.bio.IO import monix.execution.Scheduler -import org.scalatest.concurrent.Eventually -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike -import org.scalatest.{CancelAfterFailure, Inspectors, OptionValues} +import org.scalatest.CancelAfterFailure import java.util.UUID import scala.annotation.nowarn -import scala.concurrent.duration._ - -class ElasticSearchQuerySpec - extends AnyWordSpecLike - with Matchers - with EitherValues - with CirceLiteral - with TestHelpers - with CancelAfterFailure - with Inspectors - with OptionValues - with ConfigFixtures - with Fixtures - with BIOValues - with Eventually - with TestMatchers { - implicit override def patienceConfig: PatienceConfig = PatienceConfig(6.seconds, 100.millis) + +class ElasticSearchQuerySpec extends BioSpec with CirceLiteral with CancelAfterFailure { implicit private val sc: Scheduler = Scheduler.global implicit val baseUri: BaseUri = BaseUri("http://localhost", Label.unsafe("v1")) diff --git a/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/projections/CompositeProjectionsSuite.scala b/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/projections/CompositeProjectionsSuite.scala index 72f1556da7..d2d43eb264 100644 --- a/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/projections/CompositeProjectionsSuite.scala +++ b/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/projections/CompositeProjectionsSuite.scala @@ -3,8 +3,8 @@ package ch.epfl.bluebrain.nexus.delta.plugins.compositeviews.projections import cats.effect.concurrent.Ref import ch.epfl.bluebrain.nexus.delta.plugins.compositeviews.model.CompositeRestart.FullRestart import ch.epfl.bluebrain.nexus.delta.plugins.compositeviews.store.{CompositeProgressStore, CompositeRestartStore} -import ch.epfl.bluebrain.nexus.delta.plugins.compositeviews.stream.{CompositeBranch, CompositeProgress} import ch.epfl.bluebrain.nexus.delta.plugins.compositeviews.stream.CompositeBranch.Run +import ch.epfl.bluebrain.nexus.delta.plugins.compositeviews.stream.{CompositeBranch, CompositeProgress} import ch.epfl.bluebrain.nexus.delta.rdf.Vocabulary.nxv import ch.epfl.bluebrain.nexus.delta.sdk.ConfigFixtures import ch.epfl.bluebrain.nexus.delta.sdk.views.{IndexingRev, IndexingViewRef, ViewRef} @@ -12,23 +12,17 @@ import ch.epfl.bluebrain.nexus.delta.sourcing.config.BatchConfig import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.Anonymous import ch.epfl.bluebrain.nexus.delta.sourcing.model.ProjectRef import ch.epfl.bluebrain.nexus.delta.sourcing.offset.Offset -import ch.epfl.bluebrain.nexus.delta.sourcing.stream.ProjectionProgress -import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.Doobie +import ch.epfl.bluebrain.nexus.delta.sourcing.stream.ProjectionProgress import ch.epfl.bluebrain.nexus.testkit.mu.bio.{BioSuite, PatienceConfig} +import fs2.Stream +import monix.bio.Task import munit.AnyFixture import java.time.Instant -import concurrent.duration._ -import fs2.Stream -import monix.bio.Task +import scala.concurrent.duration._ -class CompositeProjectionsSuite - extends BioSuite - with IOFixedClock - with Doobie.Fixture - with Doobie.Assertions - with ConfigFixtures { +class CompositeProjectionsSuite extends BioSuite with Doobie.Fixture with Doobie.Assertions with ConfigFixtures { override def munitFixtures: Seq[AnyFixture[_]] = List(doobie) diff --git a/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/store/CompositeProgressStoreSuite.scala b/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/store/CompositeProgressStoreSuite.scala index 74f062e78f..ccf4f7d4fd 100644 --- a/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/store/CompositeProgressStoreSuite.scala +++ b/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/store/CompositeProgressStoreSuite.scala @@ -8,15 +8,14 @@ import ch.epfl.bluebrain.nexus.delta.sdk.views.{IndexingRev, IndexingViewRef, Vi import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.Anonymous import ch.epfl.bluebrain.nexus.delta.sourcing.model.ProjectRef import ch.epfl.bluebrain.nexus.delta.sourcing.offset.Offset -import ch.epfl.bluebrain.nexus.delta.sourcing.stream.ProjectionProgress -import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.Doobie +import ch.epfl.bluebrain.nexus.delta.sourcing.stream.ProjectionProgress import ch.epfl.bluebrain.nexus.testkit.mu.bio.BioSuite import munit.AnyFixture import java.time.Instant -class CompositeProgressStoreSuite extends BioSuite with IOFixedClock with Doobie.Fixture with Doobie.Assertions { +class CompositeProgressStoreSuite extends BioSuite with Doobie.Fixture with Doobie.Assertions { override def munitFixtures: Seq[AnyFixture[_]] = List(doobie) diff --git a/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/store/CompositeRestartStoreSuite.scala b/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/store/CompositeRestartStoreSuite.scala index 8b75562284..5d1a65cd5d 100644 --- a/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/store/CompositeRestartStoreSuite.scala +++ b/delta/plugins/composite-views/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/compositeviews/store/CompositeRestartStoreSuite.scala @@ -7,15 +7,14 @@ import ch.epfl.bluebrain.nexus.delta.sdk.views.ViewRef import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.Anonymous import ch.epfl.bluebrain.nexus.delta.sourcing.model.ProjectRef import ch.epfl.bluebrain.nexus.delta.sourcing.offset.Offset -import ch.epfl.bluebrain.nexus.delta.sourcing.stream.Elem.SuccessElem -import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.Doobie +import ch.epfl.bluebrain.nexus.delta.sourcing.stream.Elem.SuccessElem import ch.epfl.bluebrain.nexus.testkit.mu.bio.BioSuite import munit.AnyFixture import java.time.Instant -class CompositeRestartStoreSuite extends BioSuite with IOFixedClock with Doobie.Fixture with Doobie.Assertions { +class CompositeRestartStoreSuite extends BioSuite with Doobie.Fixture with Doobie.Assertions { override def munitFixtures: Seq[AnyFixture[_]] = List(doobie) diff --git a/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/ElasticSearchScopeInitializationSpec.scala b/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/ElasticSearchScopeInitializationSpec.scala index 888d04137d..23dd881edc 100644 --- a/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/ElasticSearchScopeInitializationSpec.scala +++ b/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/ElasticSearchScopeInitializationSpec.scala @@ -17,24 +17,13 @@ import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Subject, User} import ch.epfl.bluebrain.nexus.delta.sourcing.model.Label import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.DoobieScalaTestFixture import ch.epfl.bluebrain.nexus.delta.sourcing.stream.pipes.{DefaultLabelPredicates, SourceAsText} -import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsIOValues -import ch.epfl.bluebrain.nexus.testkit.TestHelpers -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike -import org.scalatest.{Inspectors, OptionValues} +import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsEffectSpec import java.util.UUID class ElasticSearchScopeInitializationSpec - extends DoobieScalaTestFixture - with AnyWordSpecLike - with Matchers - with Inspectors - with CatsIOValues - with OptionValues - with EitherValues - with TestHelpers + extends CatsEffectSpec + with DoobieScalaTestFixture with ConfigFixtures with Fixtures { diff --git a/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/ElasticSearchViewDecodingSpec.scala b/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/ElasticSearchViewDecodingSpec.scala index 1d091f7ff2..d07f837268 100644 --- a/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/ElasticSearchViewDecodingSpec.scala +++ b/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/ElasticSearchViewDecodingSpec.scala @@ -15,24 +15,13 @@ import ch.epfl.bluebrain.nexus.delta.sdk.views.{PipeStep, ViewRef} import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef} import ch.epfl.bluebrain.nexus.delta.sourcing.stream.pipes._ -import ch.epfl.bluebrain.nexus.testkit.TestHelpers -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import io.circe.literal._ import monix.execution.Scheduler.Implicits.global -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike -import org.scalatest.{Inspectors, OptionValues} import java.util.UUID -class ElasticSearchViewDecodingSpec - extends AnyWordSpecLike - with Matchers - with Inspectors - with BIOValues - with TestHelpers - with OptionValues - with Fixtures { +class ElasticSearchViewDecodingSpec extends BioSpec with Fixtures { private val ref = ProjectRef.unsafe("org", "proj") private val context = ProjectContext.unsafe( diff --git a/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/ElasticSearchViewSTMSpec.scala b/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/ElasticSearchViewSTMSpec.scala index b5bbd449e5..ec7aeff08c 100644 --- a/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/ElasticSearchViewSTMSpec.scala +++ b/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/ElasticSearchViewSTMSpec.scala @@ -17,28 +17,15 @@ import ch.epfl.bluebrain.nexus.delta.sdk.views.{IndexingRev, ViewRef} import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Anonymous, Subject, User} import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef} -import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import io.circe.Json import monix.bio.IO import monix.execution.Scheduler -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike -import org.scalatest.{Inspectors, OptionValues} import java.time.Instant import java.util.UUID -class ElasticSearchViewSTMSpec - extends AnyWordSpecLike - with Matchers - with OptionValues - with EitherValues - with Inspectors - with IOFixedClock - with BIOValues - with Fixtures { +class ElasticSearchViewSTMSpec extends BioSpec { "An ElasticSearch STM" when { diff --git a/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/ElasticSearchViewsSpec.scala b/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/ElasticSearchViewsSpec.scala index bb6586296c..74fafed988 100644 --- a/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/ElasticSearchViewsSpec.scala +++ b/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/ElasticSearchViewsSpec.scala @@ -25,26 +25,15 @@ import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef} import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.DoobieScalaTestFixture import ch.epfl.bluebrain.nexus.delta.sourcing.stream.PipeChain import ch.epfl.bluebrain.nexus.delta.sourcing.stream.pipes.{FilterBySchema, FilterByType, FilterDeprecated} -import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import io.circe.Json import io.circe.literal._ import monix.bio.{IO, UIO} -import org.scalatest.matchers.should.Matchers -import org.scalatest.{Inspectors, OptionValues} import java.time.Instant import java.util.UUID -class ElasticSearchViewsSpec - extends DoobieScalaTestFixture - with Matchers - with Inspectors - with OptionValues - with EitherValues - with IOFixedClock - with ConfigFixtures - with Fixtures { +class ElasticSearchViewsSpec extends BioSpec with DoobieScalaTestFixture with ConfigFixtures with Fixtures { private val realm = Label.unsafe("myrealm") implicit private val alice: Caller = Caller(User("Alice", realm), Set(User("Alice", realm), Group("users", realm))) diff --git a/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/client/IndexLabelSpec.scala b/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/client/IndexLabelSpec.scala index 8520035962..65351058a2 100644 --- a/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/client/IndexLabelSpec.scala +++ b/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/client/IndexLabelSpec.scala @@ -1,13 +1,9 @@ package ch.epfl.bluebrain.nexus.delta.plugins.elasticsearch.client import ch.epfl.bluebrain.nexus.delta.plugins.elasticsearch.client.IndexLabel.{IllegalIndexLabel, IndexGroup} -import ch.epfl.bluebrain.nexus.testkit.TestHelpers -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues -import org.scalatest.Inspectors -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec -class IndexLabelSpec extends AnyWordSpecLike with Matchers with Inspectors with TestHelpers with EitherValues { +class IndexLabelSpec extends BaseSpec { "An IndexLabel" should { "fail" in { val list = List(".", ".s", "+s", "s*e", "s?e", "s/e", "s|e", "s\\e", "s,e", genString(length = 210)) diff --git a/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/model/ElasticSearchViewSpec.scala b/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/model/ElasticSearchViewSpec.scala index a3aec71df2..e130c2bbd9 100644 --- a/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/model/ElasticSearchViewSpec.scala +++ b/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/model/ElasticSearchViewSpec.scala @@ -12,23 +12,12 @@ import ch.epfl.bluebrain.nexus.delta.sdk.views.{PipeStep, ViewRef} import ch.epfl.bluebrain.nexus.delta.sourcing.model.ProjectRef import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag import ch.epfl.bluebrain.nexus.delta.sourcing.stream.pipes._ -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues -import ch.epfl.bluebrain.nexus.testkit.{CirceEq, CirceLiteral, TestHelpers} -import org.scalatest.Inspectors -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec +import ch.epfl.bluebrain.nexus.testkit.{CirceEq, CirceLiteral} import java.util.UUID -class ElasticSearchViewSpec - extends AnyWordSpecLike - with Matchers - with Inspectors - with CirceLiteral - with TestHelpers - with BIOValues - with CirceEq - with Fixtures { +class ElasticSearchViewSpec extends BioSpec with CirceLiteral with CirceEq with Fixtures { private val id = nxv + "myview" private val project = ProjectRef.unsafe("org", "project") diff --git a/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/routes/ElasticSearchViewsRoutesFixtures.scala b/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/routes/ElasticSearchViewsRoutesFixtures.scala index 1578eede13..89bd7af290 100644 --- a/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/routes/ElasticSearchViewsRoutesFixtures.scala +++ b/delta/plugins/elasticsearch/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/elasticsearch/routes/ElasticSearchViewsRoutesFixtures.scala @@ -21,31 +21,20 @@ import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Anonymous, Authent import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef} import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.DoobieScalaTestFixture import ch.epfl.bluebrain.nexus.testkit._ -import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock import ch.epfl.bluebrain.nexus.testkit.ce.CatsRunContext -import ch.epfl.bluebrain.nexus.testkit.scalatest.TestMatchers -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues import monix.execution.Scheduler -import org.scalatest.matchers.should.Matchers -import org.scalatest.{CancelAfterFailure, Inspectors, OptionValues} +import org.scalatest.CancelAfterFailure import java.util.UUID class ElasticSearchViewsRoutesFixtures extends RouteHelpers with DoobieScalaTestFixture - with Matchers with CirceLiteral with CirceEq - with IOFixedClock - with BIOValues with CatsRunContext - with OptionValues - with TestMatchers - with Inspectors with CancelAfterFailure with ConfigFixtures - with TestHelpers with CirceMarshalling with Fixtures { diff --git a/delta/plugins/graph-analytics/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/graph/analytics/AnalyticsGraphSpec.scala b/delta/plugins/graph-analytics/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/graph/analytics/AnalyticsGraphSpec.scala index a9b34f4034..dcc0eceda0 100644 --- a/delta/plugins/graph-analytics/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/graph/analytics/AnalyticsGraphSpec.scala +++ b/delta/plugins/graph-analytics/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/graph/analytics/AnalyticsGraphSpec.scala @@ -4,11 +4,8 @@ import ch.epfl.bluebrain.nexus.delta.plugins.graph.analytics.model.AnalyticsGrap import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.api.{JsonLdApi, JsonLdJavaApi} import ch.epfl.bluebrain.nexus.delta.sdk.syntax._ import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec -import ch.epfl.bluebrain.nexus.testkit.TestHelpers -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues -import org.scalatest.matchers.should.Matchers -class AnalyticsGraphSpec extends BioSpec with Matchers with TestHelpers with EitherValues with ContextFixtures { +class AnalyticsGraphSpec extends BioSpec with ContextFixtures { "A AnalyticsGraph" should { diff --git a/delta/plugins/graph-analytics/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/graph/analytics/JsonLdDocumentSpec.scala b/delta/plugins/graph-analytics/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/graph/analytics/JsonLdDocumentSpec.scala index 9e77157d4d..a0943d59b4 100644 --- a/delta/plugins/graph-analytics/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/graph/analytics/JsonLdDocumentSpec.scala +++ b/delta/plugins/graph-analytics/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/graph/analytics/JsonLdDocumentSpec.scala @@ -6,24 +6,14 @@ import ch.epfl.bluebrain.nexus.delta.rdf.IriOrBNode.Iri import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.ExpandedJsonLd import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.api.{JsonLdApi, JsonLdJavaApi} import ch.epfl.bluebrain.nexus.delta.sdk.syntax._ -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues +import ch.epfl.bluebrain.nexus.testkit.CirceEq +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsIOValues -import ch.epfl.bluebrain.nexus.testkit.{CirceEq, TestHelpers} import io.circe.syntax.EncoderOps import monix.bio.UIO -import org.scalatest.OptionValues -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike -class JsonLdDocumentSpec - extends AnyWordSpecLike - with Matchers - with TestHelpers - with BIOValues - with CatsIOValues - with OptionValues - with ContextFixtures - with CirceEq { +class JsonLdDocumentSpec extends BioSpec with CatsIOValues with ContextFixtures with CirceEq { + "A JsonLdDocument" should { implicit val jsonLdApi: JsonLdApi = JsonLdJavaApi.lenient val input = jsonContentOf("reconstructed-cell.json") diff --git a/delta/plugins/graph-analytics/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/graph/analytics/PropertiesStatisticsSpec.scala b/delta/plugins/graph-analytics/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/graph/analytics/PropertiesStatisticsSpec.scala index e385c90626..a36c3834c0 100644 --- a/delta/plugins/graph-analytics/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/graph/analytics/PropertiesStatisticsSpec.scala +++ b/delta/plugins/graph-analytics/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/graph/analytics/PropertiesStatisticsSpec.scala @@ -4,19 +4,9 @@ import ch.epfl.bluebrain.nexus.delta.plugins.graph.analytics.model.PropertiesSta import ch.epfl.bluebrain.nexus.delta.plugins.graph.analytics.model.PropertiesStatistics.propertiesDecoderFromEsAggregations import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.api.{JsonLdApi, JsonLdJavaApi} import ch.epfl.bluebrain.nexus.delta.sdk.syntax._ -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues -import ch.epfl.bluebrain.nexus.testkit.TestHelpers -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec -class PropertiesStatisticsSpec - extends AnyWordSpecLike - with Matchers - with TestHelpers - with EitherValues - with BIOValues - with ContextFixtures { +class PropertiesStatisticsSpec extends BioSpec with ContextFixtures { "PropertiesStatistics" should { diff --git a/delta/plugins/jira/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/jira/TokenStoreSuite.scala b/delta/plugins/jira/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/jira/TokenStoreSuite.scala index 076c787728..06a0e2ff3e 100644 --- a/delta/plugins/jira/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/jira/TokenStoreSuite.scala +++ b/delta/plugins/jira/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/jira/TokenStoreSuite.scala @@ -4,11 +4,10 @@ import ch.epfl.bluebrain.nexus.delta.plugins.jira.OAuthToken.{AccessToken, Reque import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.User import ch.epfl.bluebrain.nexus.delta.sourcing.model.Label import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.Doobie -import ch.epfl.bluebrain.nexus.testkit.ce.IOFixedClock import ch.epfl.bluebrain.nexus.testkit.mu.ce.CatsEffectSuite import munit.AnyFixture -class TokenStoreSuite extends CatsEffectSuite with Doobie.Fixture with IOFixedClock { +class TokenStoreSuite extends CatsEffectSuite with Doobie.Fixture { override def munitFixtures: Seq[AnyFixture[_]] = List(doobie) diff --git a/delta/plugins/project-deletion/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/projectdeletion/model/ProjectDeletionConfigSpec.scala b/delta/plugins/project-deletion/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/projectdeletion/model/ProjectDeletionConfigSpec.scala index 5266a05f7b..c8c707e959 100644 --- a/delta/plugins/project-deletion/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/projectdeletion/model/ProjectDeletionConfigSpec.scala +++ b/delta/plugins/project-deletion/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/projectdeletion/model/ProjectDeletionConfigSpec.scala @@ -3,17 +3,14 @@ package ch.epfl.bluebrain.nexus.delta.plugins.projectdeletion.model import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.api.{JsonLdApi, JsonLdJavaApi} import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.context.{ContextValue, RemoteContextResolution} import ch.epfl.bluebrain.nexus.delta.sdk.implicits._ -import ch.epfl.bluebrain.nexus.testkit.TestHelpers -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import com.typesafe.config.ConfigFactory -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike import pureconfig.ConfigSource import pureconfig.error.ConfigReaderException import scala.concurrent.duration.DurationInt -class ProjectDeletionConfigSpec extends AnyWordSpecLike with Matchers with BIOValues with TestHelpers { +class ProjectDeletionConfigSpec extends BioSpec { implicit private val cl: ClassLoader = getClass.getClassLoader implicit private val api: JsonLdApi = JsonLdJavaApi.strict diff --git a/delta/plugins/search/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/search/SearchScopeInitializationSpec.scala b/delta/plugins/search/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/search/SearchScopeInitializationSpec.scala index c943d5a5c0..7d248504d5 100644 --- a/delta/plugins/search/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/search/SearchScopeInitializationSpec.scala +++ b/delta/plugins/search/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/search/SearchScopeInitializationSpec.scala @@ -15,19 +15,15 @@ import ch.epfl.bluebrain.nexus.delta.sdk.resolvers.ResolverContextResolution import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Subject, User} import ch.epfl.bluebrain.nexus.delta.sourcing.model.Label import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.DoobieScalaTestFixture -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsIOValues import io.circe.JsonObject -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike class SearchScopeInitializationSpec - extends DoobieScalaTestFixture - with AnyWordSpecLike + extends BioSpec + with DoobieScalaTestFixture with CompositeViewsFixture - with Matchers with CatsIOValues - with BIOValues with Fixtures { implicit val baseUri: BaseUri = BaseUri.withoutPrefix("http://localhost") diff --git a/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/StorageScopeInitializationSpec.scala b/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/StorageScopeInitializationSpec.scala index 43689341ba..6b0bd86dcb 100644 --- a/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/StorageScopeInitializationSpec.scala +++ b/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/StorageScopeInitializationSpec.scala @@ -15,23 +15,17 @@ import ch.epfl.bluebrain.nexus.delta.sdk.{ConfigFixtures, Defaults} import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Subject, User} import ch.epfl.bluebrain.nexus.delta.sourcing.model.Label import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.DoobieScalaTestFixture -import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsIOValues -import ch.epfl.bluebrain.nexus.testkit.TestHelpers -import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock +import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsEffectSpec import monix.bio.IO import monix.execution.Scheduler -import org.scalatest.matchers.should.Matchers import java.util.UUID class StorageScopeInitializationSpec - extends DoobieScalaTestFixture - with Matchers - with CatsIOValues - with IOFixedClock + extends CatsEffectSpec + with DoobieScalaTestFixture with RemoteContextResolutionFixture - with ConfigFixtures - with TestHelpers { + with ConfigFixtures { private val serviceAccount: ServiceAccount = ServiceAccount(User("nexus-sa", Label.unsafe("sa"))) diff --git a/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/files/FilesSpec.scala b/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/files/FilesSpec.scala index c70ffd825b..fb6e5f3608 100644 --- a/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/files/FilesSpec.scala +++ b/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/files/FilesSpec.scala @@ -36,24 +36,22 @@ import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Anonymous, Authent import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef, ResourceRef} import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.DoobieScalaTestFixture -import ch.epfl.bluebrain.nexus.testkit.remotestorage.RemoteStorageDocker -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues import ch.epfl.bluebrain.nexus.testkit.CirceLiteral -import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock +import ch.epfl.bluebrain.nexus.testkit.remotestorage.RemoteStorageDocker import monix.bio.IO import monix.execution.Scheduler import org.scalatest.concurrent.Eventually import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike import org.scalatest.{DoNotDiscover, Inspectors, OptionValues} @DoNotDiscover class FilesSpec(docker: RemoteStorageDocker) extends TestKit(ActorSystem("FilesSpec")) + with AnyWordSpecLike with DoobieScalaTestFixture with OptionValues with Matchers - with BIOValues - with IOFixedClock with Inspectors with CirceLiteral with ConfigFixtures diff --git a/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/files/FilesStmSpec.scala b/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/files/FilesStmSpec.scala index 5e8d90207f..4dcf812fb3 100644 --- a/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/files/FilesStmSpec.scala +++ b/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/files/FilesStmSpec.scala @@ -3,38 +3,24 @@ package ch.epfl.bluebrain.nexus.delta.plugins.storage.files import akka.http.scaladsl.model.{ContentTypes, Uri} import ch.epfl.bluebrain.nexus.delta.plugins.storage.files.Files.{evaluate, next} import ch.epfl.bluebrain.nexus.delta.plugins.storage.files.model.Digest.{ComputedDigest, NotComputedDigest} -import ch.epfl.bluebrain.nexus.delta.plugins.storage.files.model.{Digest, FileAttributes} import ch.epfl.bluebrain.nexus.delta.plugins.storage.files.model.FileAttributes.FileAttributesOrigin.Client -import ch.epfl.bluebrain.nexus.delta.plugins.storage.files.model.FileCommand.{CreateFile, DeleteFileTag, DeprecateFile, TagFile, UpdateFile, UpdateFileAttributes} -import ch.epfl.bluebrain.nexus.delta.plugins.storage.files.model.FileEvent.{FileAttributesUpdated, FileCreated, FileDeprecated, FileTagAdded, FileTagDeleted, FileUpdated} -import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.model.StorageType.{DiskStorage => DiskStorageType, RemoteDiskStorage => RemoteStorageType} +import ch.epfl.bluebrain.nexus.delta.plugins.storage.files.model.FileCommand._ +import ch.epfl.bluebrain.nexus.delta.plugins.storage.files.model.FileEvent._ import ch.epfl.bluebrain.nexus.delta.plugins.storage.files.model.FileRejection.{DigestAlreadyComputed, DigestNotComputed, FileIsDeprecated, FileNotFound, IncorrectRev, ResourceAlreadyExists, RevisionNotFound} +import ch.epfl.bluebrain.nexus.delta.plugins.storage.files.model.{Digest, FileAttributes} import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.StorageFixtures import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.model.DigestAlgorithm +import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.model.StorageType.{DiskStorage => DiskStorageType, RemoteDiskStorage => RemoteStorageType} import ch.epfl.bluebrain.nexus.delta.rdf.Vocabulary.nxv import ch.epfl.bluebrain.nexus.delta.sdk.model.Tags import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.User -import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ResourceRef} import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag -import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues -import org.scalatest.{Inspectors, OptionValues} -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike +import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ResourceRef} +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import java.time.Instant -class FilesStmSpec - extends AnyWordSpecLike - with Matchers - with IOFixedClock - with OptionValues - with EitherValues - with Inspectors - with BIOValues - with FileFixtures - with StorageFixtures { +class FilesStmSpec extends BioSpec with FileFixtures with StorageFixtures { private val epoch = Instant.EPOCH private val time2 = Instant.ofEpochMilli(10L) diff --git a/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/StoragesSpec.scala b/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/StoragesSpec.scala index df0ebd92f1..8d9da3c71a 100644 --- a/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/StoragesSpec.scala +++ b/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/StoragesSpec.scala @@ -17,24 +17,17 @@ import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Authenticated, Gro import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef} import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.DoobieScalaTestFixture -import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import io.circe.Json import io.circe.syntax._ import monix.bio.IO -import org.scalatest.matchers.should.Matchers -import org.scalatest.{CancelAfterFailure, Inspectors} +import org.scalatest.CancelAfterFailure import java.util.UUID -class StoragesSpec - extends DoobieScalaTestFixture - with EitherValues - with Matchers - with BIOValues - with IOFixedClock - with Inspectors +private class StoragesSpec + extends BioSpec + with DoobieScalaTestFixture with CancelAfterFailure with ConfigFixtures with StorageFixtures diff --git a/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/StoragesStmSpec.scala b/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/StoragesStmSpec.scala index ddd07df532..1bcf58dea0 100644 --- a/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/StoragesStmSpec.scala +++ b/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/StoragesStmSpec.scala @@ -1,40 +1,27 @@ package ch.epfl.bluebrain.nexus.delta.plugins.storage.storages -import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.model.StorageType.{DiskStorage => DiskStorageType} import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.StorageGen.storageState import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.Storages.{evaluate, next} import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.StoragesConfig.{DiskStorageConfig, StorageTypeConfig} -import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.model.{AbsolutePath, DigestAlgorithm} import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.model.StorageCommand.{CreateStorage, DeprecateStorage, TagStorage, UpdateStorage} import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.model.StorageEvent.{StorageCreated, StorageDeprecated, StorageTagAdded, StorageUpdated} import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.model.StorageRejection.{DifferentStorageType, IncorrectRev, InvalidMaxFileSize, InvalidStorageType, PermissionsAreNotDefined, ResourceAlreadyExists, RevisionNotFound, StorageIsDeprecated, StorageNotAccessible, StorageNotFound} +import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.model.StorageType.{DiskStorage => DiskStorageType} import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.model.StorageValue.{DiskStorageValue, RemoteDiskStorageValue, S3StorageValue} +import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.model.{AbsolutePath, DigestAlgorithm} import ch.epfl.bluebrain.nexus.delta.sdk.model.{BaseUri, Tags} import ch.epfl.bluebrain.nexus.delta.sdk.permissions.model.Permission import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.User -import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef} import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag -import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues +import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef} +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import io.circe.Json import monix.bio.IO -import org.scalatest.{Inspectors, OptionValues} -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike import java.nio.file.Files import java.time.Instant -class StoragesStmSpec - extends AnyWordSpecLike - with Matchers - with IOFixedClock - with OptionValues - with EitherValues - with Inspectors - with BIOValues - with StorageFixtures { +class StoragesStmSpec extends BioSpec with StorageFixtures { private val epoch = Instant.EPOCH private val time2 = Instant.ofEpochMilli(10L) diff --git a/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/model/StorageFieldsSpec.scala b/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/model/StorageFieldsSpec.scala index 82c7b68a13..886b291eef 100644 --- a/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/model/StorageFieldsSpec.scala +++ b/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/model/StorageFieldsSpec.scala @@ -10,16 +10,9 @@ import ch.epfl.bluebrain.nexus.delta.sdk.jsonld.JsonLdSourceProcessor.JsonLdSour import ch.epfl.bluebrain.nexus.delta.sdk.projects.model.{ApiMappings, ProjectContext} import ch.epfl.bluebrain.nexus.delta.sdk.syntax._ import ch.epfl.bluebrain.nexus.delta.sourcing.model.Label -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec -class StorageFieldsSpec - extends AnyWordSpec - with Matchers - with RemoteContextResolutionFixture - with BIOValues - with StorageFixtures { +class StorageFieldsSpec extends BioSpec with RemoteContextResolutionFixture with StorageFixtures { implicit private val cfg: Configuration = StorageDecoderConfiguration.apply.accepted val sourceDecoder = new JsonLdSourceDecoder[StorageRejection, StorageFields](contexts.storages, UUIDF.random) diff --git a/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/model/StorageSpec.scala b/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/model/StorageSpec.scala index aa8f6e793d..9e1b06f080 100644 --- a/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/model/StorageSpec.scala +++ b/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/model/StorageSpec.scala @@ -6,20 +6,11 @@ import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.model.Storage._ import ch.epfl.bluebrain.nexus.delta.rdf.Vocabulary.nxv import ch.epfl.bluebrain.nexus.delta.sdk.model.Tags import ch.epfl.bluebrain.nexus.delta.sdk.syntax._ -import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef} import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues -import org.scalatest.Inspectors -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike +import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef} +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec -class StorageSpec - extends AnyWordSpecLike - with Matchers - with Inspectors - with RemoteContextResolutionFixture - with BIOValues - with StorageFixtures { +class StorageSpec extends BioSpec with RemoteContextResolutionFixture with StorageFixtures { "A Storage" should { val project = ProjectRef(Label.unsafe("org"), Label.unsafe("project")) diff --git a/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/disk/DiskStorageAccessSpec.scala b/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/disk/DiskStorageAccessSpec.scala index 5fb7745292..01e303fc9e 100644 --- a/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/disk/DiskStorageAccessSpec.scala +++ b/delta/plugins/storage/src/test/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/storages/operations/disk/DiskStorageAccessSpec.scala @@ -5,15 +5,11 @@ import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.model.StorageValue import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.model.{AbsolutePath, DigestAlgorithm} import ch.epfl.bluebrain.nexus.delta.plugins.storage.storages.permissions._ import ch.epfl.bluebrain.nexus.delta.sdk.syntax._ -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues -import ch.epfl.bluebrain.nexus.testkit.TestHelpers -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import java.nio.file.{Files, Path} -class DiskStorageAccessSpec extends AnyWordSpecLike with Matchers with BIOValues with EitherValues with TestHelpers { +class DiskStorageAccessSpec extends BioSpec { "A DiskStorage access operations" should { val iri = iri"http://localhost/disk" diff --git a/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/IriSpec.scala b/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/IriSpec.scala index fd42253721..f795479b4b 100644 --- a/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/IriSpec.scala +++ b/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/IriSpec.scala @@ -5,14 +5,11 @@ import cats.implicits._ import ch.epfl.bluebrain.nexus.delta.rdf.IriOrBNode.Iri import ch.epfl.bluebrain.nexus.delta.rdf.Vocabulary.{owl, schema, xsd} import ch.epfl.bluebrain.nexus.delta.rdf.implicits._ -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec import io.circe.Json import io.circe.syntax._ -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike -import org.scalatest.{Inspectors, OptionValues} -class IriSpec extends AnyWordSpecLike with Matchers with Inspectors with EitherValues with OptionValues { +class IriSpec extends BaseSpec { "An Iri" should { val iriString = "http://example.com/a" diff --git a/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/UriSpec.scala b/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/UriSpec.scala index fcb9dddb4a..0bd0523972 100644 --- a/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/UriSpec.scala +++ b/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/UriSpec.scala @@ -2,14 +2,11 @@ package ch.epfl.bluebrain.nexus.delta.rdf import akka.http.scaladsl.model.Uri import ch.epfl.bluebrain.nexus.delta.rdf.implicits._ -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec import io.circe.Json import io.circe.syntax._ -import org.scalatest.{Inspectors, OptionValues} -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike -class UriSpec extends AnyWordSpecLike with Matchers with EitherValues with Inspectors with OptionValues { +class UriSpec extends BaseSpec { "A Uri" should { val uriString = "http://example.com/path" val uri = uri"$uriString" diff --git a/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/jsonld/ExpandedJsonLdCursorSpec.scala b/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/jsonld/ExpandedJsonLdCursorSpec.scala index 2f77329ab3..7247480ee9 100644 --- a/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/jsonld/ExpandedJsonLdCursorSpec.scala +++ b/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/jsonld/ExpandedJsonLdCursorSpec.scala @@ -3,20 +3,10 @@ package ch.epfl.bluebrain.nexus.delta.rdf.jsonld import ch.epfl.bluebrain.nexus.delta.rdf.Vocabulary.schema import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.decoder.JsonLdDecoderError.ParsingFailure.KeyMissingFailure import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.decoder.JsonLdDecoderError.{DecodingFailure, ParsingFailure} -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues -import ch.epfl.bluebrain.nexus.testkit.{CirceLiteral, TestHelpers} +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec import io.circe.CursorOp.{DownArray, DownField} -import org.scalatest.Inspectors -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike - -class ExpandedJsonLdCursorSpec - extends AnyWordSpecLike - with Matchers - with Inspectors - with CirceLiteral - with EitherValues - with TestHelpers { + +class ExpandedJsonLdCursorSpec extends BaseSpec { "An ExpandedJsonLdCursor" should { val json = jsonContentOf("/jsonld/decoder/cocktail.json") diff --git a/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/jsonld/context/ContextValueSpec.scala b/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/jsonld/context/ContextValueSpec.scala index 364fa838c6..6f3d975fc1 100644 --- a/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/jsonld/context/ContextValueSpec.scala +++ b/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/jsonld/context/ContextValueSpec.scala @@ -3,12 +3,10 @@ package ch.epfl.bluebrain.nexus.delta.rdf.jsonld.context import ch.epfl.bluebrain.nexus.delta.rdf.Fixtures import ch.epfl.bluebrain.nexus.delta.rdf.Vocabulary.contexts import ch.epfl.bluebrain.nexus.delta.rdf.syntax._ +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec import io.circe.Json -import org.scalatest.Inspectors -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike -class ContextValueSpec extends AnyWordSpecLike with Matchers with Fixtures with Inspectors { +class ContextValueSpec extends BaseSpec with Fixtures { "A @context value" should { diff --git a/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/jsonld/decoder/JsonLdDecoderSpec.scala b/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/jsonld/decoder/JsonLdDecoderSpec.scala index 86153c5f33..abc4c42159 100644 --- a/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/jsonld/decoder/JsonLdDecoderSpec.scala +++ b/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/jsonld/decoder/JsonLdDecoderSpec.scala @@ -12,7 +12,6 @@ import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.decoder.JsonLdDecoderSpec.{Absol import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.decoder.configuration.semiauto._ import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.decoder.semiauto._ import ch.epfl.bluebrain.nexus.delta.rdf.syntax._ -import ch.epfl.bluebrain.nexus.testkit.CirceLiteral import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsEffectSpec @@ -22,7 +21,7 @@ import scala.annotation.nowarn import scala.concurrent.duration._ @nowarn("cat=unused") -class JsonLdDecoderSpec extends CatsEffectSpec with CirceLiteral with BIOValues with Fixtures { +class JsonLdDecoderSpec extends CatsEffectSpec with BIOValues with Fixtures { implicit private val rcr: RemoteContextResolution = RemoteContextResolution.fixed() diff --git a/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/query/SparqlQuerySpec.scala b/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/query/SparqlQuerySpec.scala index b3323b78b3..b4c15666b4 100644 --- a/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/query/SparqlQuerySpec.scala +++ b/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/query/SparqlQuerySpec.scala @@ -1,11 +1,9 @@ package ch.epfl.bluebrain.nexus.delta.rdf.query import ch.epfl.bluebrain.nexus.delta.rdf.query.SparqlQuery.SparqlConstructQuery -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpec +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec -class SparqlQuerySpec extends AnyWordSpec with Matchers with EitherValues { +class SparqlQuerySpec extends BaseSpec { val validSparql = """SELECT ?s ?p ?o WHERE { ?s ?p ?o }""" diff --git a/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/shacl/ShaclEngineSpec.scala b/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/shacl/ShaclEngineSpec.scala index c81542de70..31ca6ff829 100644 --- a/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/shacl/ShaclEngineSpec.scala +++ b/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/shacl/ShaclEngineSpec.scala @@ -7,22 +7,10 @@ import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.api.{JsonLdApi, JsonLdJavaApi} import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.context.JsonLdContext.keywords import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.context.RemoteContextResolution import ch.epfl.bluebrain.nexus.delta.rdf.syntax._ -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsIOValues -import ch.epfl.bluebrain.nexus.testkit.TestHelpers -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues -import org.scalatest.Inspectors -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike -class ShaclEngineSpec - extends AnyWordSpecLike - with Matchers - with TestHelpers - with BIOValues - with CatsIOValues - with EitherValues - with Inspectors { +class ShaclEngineSpec extends BioSpec with CatsIOValues { implicit val api: JsonLdApi = JsonLdJavaApi.lenient diff --git a/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/shacl/ValidationReportSpec.scala b/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/shacl/ValidationReportSpec.scala index 6b10f9c7df..6aef276791 100644 --- a/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/shacl/ValidationReportSpec.scala +++ b/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/shacl/ValidationReportSpec.scala @@ -6,26 +6,14 @@ import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.ExpandedJsonLd import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.api.{JsonLdApi, JsonLdJavaApi} import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.context.RemoteContextResolution import ch.epfl.bluebrain.nexus.delta.rdf.syntax._ -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsIOValues -import ch.epfl.bluebrain.nexus.testkit.TestHelpers -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues import io.circe.Json import io.circe.syntax._ import org.apache.jena.query.DatasetFactory import org.apache.jena.rdf.model.Resource -import org.scalatest.OptionValues -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike -class ValidationReportSpec - extends AnyWordSpecLike - with Matchers - with TestHelpers - with EitherValues - with OptionValues - with CatsIOValues - with BIOValues { +class ValidationReportSpec extends BioSpec with CatsIOValues { implicit val api: JsonLdApi = JsonLdJavaApi.strict diff --git a/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/utils/PathUtilsSpec.scala b/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/utils/PathUtilsSpec.scala index 1088300361..d581eb5536 100644 --- a/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/utils/PathUtilsSpec.scala +++ b/delta/rdf/src/test/scala/ch/epfl/bluebrain/nexus/delta/rdf/utils/PathUtilsSpec.scala @@ -1,12 +1,11 @@ package ch.epfl.bluebrain.nexus.delta.rdf.utils -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike import ch.epfl.bluebrain.nexus.delta.rdf.syntax._ +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec import java.nio.file.Paths -class PathUtilsSpec extends AnyWordSpecLike with Matchers { +class PathUtilsSpec extends BaseSpec { "A Path" should { val `/tmp/a` = Paths.get("/tmp/a") val `/tmp/a/b/c` = Paths.get("/tmp/a/b/c") diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/AclsSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/AclsSpec.scala index 0e3a013569..b3f7324dac 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/AclsSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/AclsSpec.scala @@ -1,35 +1,22 @@ package ch.epfl.bluebrain.nexus.delta.sdk import ch.epfl.bluebrain.nexus.delta.sdk.acls.Acls.{evaluate, next} -import ch.epfl.bluebrain.nexus.delta.sdk.acls.{AclFixtures, Acls} -import ch.epfl.bluebrain.nexus.delta.sdk.acls.model.{Acl, AclCommand, AclEvent, AclRejection, AclState} import ch.epfl.bluebrain.nexus.delta.sdk.acls.model.AclAddress.Root import ch.epfl.bluebrain.nexus.delta.sdk.acls.model.AclCommand.{AppendAcl, DeleteAcl, ReplaceAcl, SubtractAcl} import ch.epfl.bluebrain.nexus.delta.sdk.acls.model.AclEvent.{AclAppended, AclDeleted, AclReplaced, AclSubtracted} import ch.epfl.bluebrain.nexus.delta.sdk.acls.model.AclRejection._ +import ch.epfl.bluebrain.nexus.delta.sdk.acls.model._ +import ch.epfl.bluebrain.nexus.delta.sdk.acls.{AclFixtures, Acls} import ch.epfl.bluebrain.nexus.delta.sdk.permissions.model.Permission import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Anonymous, User} import ch.epfl.bluebrain.nexus.delta.sourcing.model.Label -import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import monix.bio.{IO, UIO} import monix.execution.Scheduler -import org.scalatest.{Inspectors, OptionValues} -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike import java.time.Instant -class AclsSpec - extends AnyWordSpecLike - with Matchers - with EitherValues - with OptionValues - with AclFixtures - with Inspectors - with IOFixedClock - with BIOValues { +class AclsSpec extends BioSpec with AclFixtures { "The ACL state machine" when { implicit val sc: Scheduler = Scheduler.global diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/acls/AclSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/acls/AclSpec.scala index 333effdceb..dc288f0d46 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/acls/AclSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/acls/AclSpec.scala @@ -1,14 +1,12 @@ package ch.epfl.bluebrain.nexus.delta.sdk.acls -import ch.epfl.bluebrain.nexus.delta.sdk.acls.model.AclAddress.{Organization, Root} import ch.epfl.bluebrain.nexus.delta.sdk.acls.model.Acl +import ch.epfl.bluebrain.nexus.delta.sdk.acls.model.AclAddress.{Organization, Root} import ch.epfl.bluebrain.nexus.delta.sdk.permissions.model.Permission import ch.epfl.bluebrain.nexus.delta.sourcing.model.Label -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec -class AclSpec extends AnyWordSpecLike with Matchers with EitherValues with AclFixtures { +class AclSpec extends BaseSpec with AclFixtures { "An Access Control List" should { diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/acls/AclsImplSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/acls/AclsImplSpec.scala index a62ec0e2a4..35ca19d259 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/acls/AclsImplSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/acls/AclsImplSpec.scala @@ -15,26 +15,19 @@ import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Anonymous, Group, import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Identity, Label, ProjectRef} import ch.epfl.bluebrain.nexus.delta.sourcing.offset.Offset import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.DoobieScalaTestFixture -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsIOValues -import ch.epfl.bluebrain.nexus.testkit.CirceLiteral -import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock import monix.bio.UIO import monix.execution.Scheduler -import org.scalatest.matchers.should.Matchers -import org.scalatest.{CancelAfterFailure, Inspectors} +import org.scalatest.CancelAfterFailure import java.time.Instant class AclsImplSpec - extends DoobieScalaTestFixture - with BIOValues - with IOFixedClock + extends BioSpec + with DoobieScalaTestFixture with CatsIOValues - with Inspectors - with Matchers with CancelAfterFailure - with CirceLiteral with ConfigFixtures { val epoch: Instant = Instant.EPOCH diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/ce/CatsResponseToJsonLdSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/ce/CatsResponseToJsonLdSpec.scala index 1d5dc7a23c..20c4b0e772 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/ce/CatsResponseToJsonLdSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/ce/CatsResponseToJsonLdSpec.scala @@ -7,6 +7,7 @@ import akka.http.scaladsl.model.{ContentType, StatusCodes} import akka.http.scaladsl.server.RouteConcatenation import akka.stream.scaladsl.Source import akka.util.ByteString +import cats.effect.{IO => CatsIO} import ch.epfl.bluebrain.nexus.delta.rdf.RdfMediaTypes.`application/ld+json` import ch.epfl.bluebrain.nexus.delta.rdf.Vocabulary.contexts import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.context.RemoteContextResolution @@ -20,10 +21,7 @@ import ch.epfl.bluebrain.nexus.delta.sdk.resources.model.ResourceRejection import ch.epfl.bluebrain.nexus.delta.sdk.resources.model.ResourceRejection.BlankResourceId import ch.epfl.bluebrain.nexus.delta.sdk.utils.RouteHelpers import ch.epfl.bluebrain.nexus.delta.sdk.{AkkaSource, SimpleRejection, SimpleResource} -import ch.epfl.bluebrain.nexus.testkit.scalatest.ShouldMatchers.convertToAnyShouldWrapper -import ch.epfl.bluebrain.nexus.testkit.TestHelpers.jsonContentOf import monix.bio.IO -import cats.effect.{IO => CatsIO} import monix.execution.Scheduler class CatsResponseToJsonLdSpec extends RouteHelpers with JsonSyntax with RouteConcatenation { diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/deletion/ProjectDeletionCoordinatorSuite.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/deletion/ProjectDeletionCoordinatorSuite.scala index a2af2c334c..dbb33aba6b 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/deletion/ProjectDeletionCoordinatorSuite.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/deletion/ProjectDeletionCoordinatorSuite.scala @@ -1,7 +1,7 @@ package ch.epfl.bluebrain.nexus.delta.sdk.deletion -import cats.syntax.all._ import cats.effect.concurrent.Ref +import cats.syntax.all._ import ch.epfl.bluebrain.nexus.delta.rdf.Vocabulary.nxv import ch.epfl.bluebrain.nexus.delta.sdk.ConfigFixtures import ch.epfl.bluebrain.nexus.delta.sdk.deletion.ProjectDeletionCoordinator.{Active, Noop} @@ -16,13 +16,12 @@ import ch.epfl.bluebrain.nexus.delta.sdk.projects.model.ProjectRejection.{Projec import ch.epfl.bluebrain.nexus.delta.sdk.projects.model.{ApiMappings, PrefixIri, ProjectFields} import ch.epfl.bluebrain.nexus.delta.sdk.projects.{ProjectsConfig, ProjectsFixture} import ch.epfl.bluebrain.nexus.delta.sdk.syntax._ -import ch.epfl.bluebrain.nexus.delta.sourcing.implicits._ import ch.epfl.bluebrain.nexus.delta.sourcing.EntityDependencyStore +import ch.epfl.bluebrain.nexus.delta.sourcing.implicits._ import ch.epfl.bluebrain.nexus.delta.sourcing.model.EntityDependency.DependsOn import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.Subject import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Identity, Label, ProjectRef} import ch.epfl.bluebrain.nexus.delta.sourcing.offset.Offset -import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock import ch.epfl.bluebrain.nexus.testkit.mu.bio.BioSuite import doobie.implicits._ import monix.bio.{IO, Task, UIO} @@ -31,7 +30,7 @@ import munit.AnyFixture import java.time.Instant import java.util.UUID -class ProjectDeletionCoordinatorSuite extends BioSuite with IOFixedClock with ConfigFixtures { +class ProjectDeletionCoordinatorSuite extends BioSuite with ConfigFixtures { implicit private val subject: Subject = Identity.User("Bob", Label.unsafe("realm")) diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/directives/ResponseToJsonLdSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/directives/ResponseToJsonLdSpec.scala index 747f6792c9..8936e6c5ce 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/directives/ResponseToJsonLdSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/directives/ResponseToJsonLdSpec.scala @@ -19,8 +19,6 @@ import ch.epfl.bluebrain.nexus.delta.sdk.resources.model.ResourceRejection import ch.epfl.bluebrain.nexus.delta.sdk.resources.model.ResourceRejection.BlankResourceId import ch.epfl.bluebrain.nexus.delta.sdk.utils.RouteHelpers import ch.epfl.bluebrain.nexus.delta.sdk.{AkkaSource, SimpleRejection, SimpleResource} -import ch.epfl.bluebrain.nexus.testkit.scalatest.ShouldMatchers.convertToAnyShouldWrapper -import ch.epfl.bluebrain.nexus.testkit.TestHelpers.jsonContentOf import monix.bio.IO import monix.execution.Scheduler diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/identities/model/CallerSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/identities/model/CallerSpec.scala index a603691f15..072f2eaea4 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/identities/model/CallerSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/identities/model/CallerSpec.scala @@ -1,10 +1,9 @@ package ch.epfl.bluebrain.nexus.delta.sdk.identities.model import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec -class CallerSpec extends AnyWordSpecLike with Matchers { +class CallerSpec extends BaseSpec { "A Caller" should { "append the subject to the identities set" in { diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/identities/model/TokenRejectionSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/identities/model/TokenRejectionSpec.scala index 6e25834af4..4f2e90eb06 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/identities/model/TokenRejectionSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/identities/model/TokenRejectionSpec.scala @@ -1,24 +1,14 @@ package ch.epfl.bluebrain.nexus.delta.sdk.identities.model -import ch.epfl.bluebrain.nexus.delta.rdf.Vocabulary.{contexts, nxv} import ch.epfl.bluebrain.nexus.delta.kernel.jwt.TokenRejection._ +import ch.epfl.bluebrain.nexus.delta.rdf.Vocabulary.{contexts, nxv} +import ch.epfl.bluebrain.nexus.delta.sdk.error.IdentityError._ import ch.epfl.bluebrain.nexus.delta.sdk.syntax._ import ch.epfl.bluebrain.nexus.delta.sdk.utils.Fixtures -import ch.epfl.bluebrain.nexus.testkit.{CirceLiteral, TestHelpers} -import org.scalatest.Inspectors -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike -import ch.epfl.bluebrain.nexus.delta.sdk.error.IdentityError._ -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues +import ch.epfl.bluebrain.nexus.testkit.CirceLiteral +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec -class TokenRejectionSpec - extends AnyWordSpecLike - with Matchers - with Inspectors - with CirceLiteral - with TestHelpers - with BIOValues - with Fixtures { +class TokenRejectionSpec extends BioSpec with CirceLiteral with Fixtures { "A TokenRejection" should { diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/jsonld/IdentityIriEncodingSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/jsonld/IdentityIriEncodingSpec.scala index 17fb667dc8..b86af1fac9 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/jsonld/IdentityIriEncodingSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/jsonld/IdentityIriEncodingSpec.scala @@ -2,16 +2,13 @@ package ch.epfl.bluebrain.nexus.delta.sdk.jsonld import ch.epfl.bluebrain.nexus.delta.rdf.IriOrBNode import ch.epfl.bluebrain.nexus.delta.sdk.error.FormatErrors.{IllegalIdentityIriFormatError, IllegalSubjectIriFormatError} -import ch.epfl.bluebrain.nexus.delta.sdk.model.BaseUri import ch.epfl.bluebrain.nexus.delta.sdk.implicits._ +import ch.epfl.bluebrain.nexus.delta.sdk.model.BaseUri import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity._ import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Identity, Label} -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues -import org.scalatest.Inspectors -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec -class IdentityIriEncodingSpec extends AnyWordSpecLike with Matchers with Inspectors with EitherValues { +class IdentityIriEncodingSpec extends BaseSpec { implicit private val base: BaseUri = BaseUri("http://localhost:8080", Label.unsafe("v1")) private val realm = Label.unsafe("myrealm") diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/IdSegmentSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/IdSegmentSpec.scala index af1beffc7c..245d19beee 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/IdSegmentSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/IdSegmentSpec.scala @@ -4,11 +4,9 @@ import ch.epfl.bluebrain.nexus.delta.rdf.Vocabulary.{nxv, schema, schemas} import ch.epfl.bluebrain.nexus.delta.sdk.model.IdSegment.{IriSegment, StringSegment} import ch.epfl.bluebrain.nexus.delta.sdk.projects.model.{ApiMappings, ProjectBase} import ch.epfl.bluebrain.nexus.delta.sdk.syntax._ -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike -import org.scalatest.{Inspectors, OptionValues} +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec -class IdSegmentSpec extends AnyWordSpecLike with Matchers with Inspectors with OptionValues { +class IdSegmentSpec extends BaseSpec { private val am = ApiMappings( "nxv" -> nxv.base, diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/NameSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/NameSpec.scala index e679eb8e12..1bca792aa3 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/NameSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/NameSpec.scala @@ -1,13 +1,9 @@ package ch.epfl.bluebrain.nexus.delta.sdk.model import ch.epfl.bluebrain.nexus.delta.sdk.error.FormatErrors.IllegalNameFormatError -import ch.epfl.bluebrain.nexus.testkit.TestHelpers -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues -import org.scalatest.Inspectors -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec -class NameSpec extends AnyWordSpecLike with Matchers with Inspectors with TestHelpers with EitherValues { +class NameSpec extends BaseSpec { "A Name" should { "be constructed correctly from alphanumeric chars, - and _" in { diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/ResourceFSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/ResourceFSpec.scala index 9108f076d2..ea60a54ffd 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/ResourceFSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/ResourceFSpec.scala @@ -7,20 +7,9 @@ import ch.epfl.bluebrain.nexus.delta.sdk.syntax._ import ch.epfl.bluebrain.nexus.delta.sdk.utils.Fixtures import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.User import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef} -import ch.epfl.bluebrain.nexus.testkit.scalatest.TestMatchers -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues -import ch.epfl.bluebrain.nexus.testkit.{CirceLiteral, TestHelpers} -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec -class ResourceFSpec - extends AnyWordSpecLike - with Matchers - with CirceLiteral - with TestHelpers - with BIOValues - with TestMatchers - with Fixtures { +class ResourceFSpec extends BioSpec with Fixtures { implicit val baseUri: BaseUri = BaseUri("http://localhost", Label.unsafe("v1")) diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/ResourceUrisSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/ResourceUrisSpec.scala index dd3522d84d..d163718827 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/ResourceUrisSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/ResourceUrisSpec.scala @@ -6,12 +6,9 @@ import ch.epfl.bluebrain.nexus.delta.rdf.Vocabulary.{nxv, schemas} import ch.epfl.bluebrain.nexus.delta.sdk.acls.model.AclAddress import ch.epfl.bluebrain.nexus.delta.sdk.model.ResourceUris.{EphemeralResourceInProjectUris, ResourceInProjectAndSchemaUris, ResourceInProjectUris} import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef} -import ch.epfl.bluebrain.nexus.testkit.TestHelpers.genString -import org.scalatest.Inspectors -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec -class ResourceUrisSpec extends AnyWordSpecLike with Matchers with Inspectors { +class ResourceUrisSpec extends BaseSpec { implicit private val baseUri: BaseUri = BaseUri("http://localhost", Label.unsafe("v1")) diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/metrics/EventMetricSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/metrics/EventMetricSpec.scala index 74e1ec8d89..f6f8ca3dd1 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/metrics/EventMetricSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/metrics/EventMetricSpec.scala @@ -2,20 +2,19 @@ package ch.epfl.bluebrain.nexus.delta.sdk.model.metrics import ch.epfl.bluebrain.nexus.delta.rdf.IriOrBNode.Iri import ch.epfl.bluebrain.nexus.delta.rdf.Vocabulary.nxv -import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Anonymous, Subject} import ch.epfl.bluebrain.nexus.delta.sdk.model.metrics.EventMetric.ProjectScopedMetric import ch.epfl.bluebrain.nexus.delta.sdk.model.metrics.EventMetricSpec.SimpleEvent import ch.epfl.bluebrain.nexus.delta.sourcing.event.Event.ScopedEvent +import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Anonymous, Subject} import ch.epfl.bluebrain.nexus.delta.sourcing.model.ProjectRef import ch.epfl.bluebrain.nexus.testkit.CirceLiteral +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec import io.circe.JsonObject import io.circe.syntax.EncoderOps -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike import java.time.Instant -class EventMetricSpec extends AnyWordSpecLike with Matchers with CirceLiteral { +class EventMetricSpec extends BaseSpec with CirceLiteral { "A metric" should { "be correctly created from the event" in { diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/search/ResultEntrySpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/search/ResultEntrySpec.scala index 7da8321a59..54701dee9b 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/search/ResultEntrySpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/search/ResultEntrySpec.scala @@ -2,10 +2,9 @@ package ch.epfl.bluebrain.nexus.delta.sdk.model.search import cats.syntax.functor._ import ch.epfl.bluebrain.nexus.delta.sdk.model.search.ResultEntry.{ScoredResultEntry, UnscoredResultEntry} -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec -class ResultEntrySpec extends AnyWordSpecLike with Matchers { +class ResultEntrySpec extends BaseSpec { "A ScoredResultEntry entry" should { diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/search/SearchParamsSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/search/SearchParamsSpec.scala index 08ac9238a9..cd25518a89 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/search/SearchParamsSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/search/SearchParamsSpec.scala @@ -2,17 +2,13 @@ package ch.epfl.bluebrain.nexus.delta.sdk.model.search import ch.epfl.bluebrain.nexus.delta.sdk.generators.{OrganizationGen, ProjectGen, RealmGen, WellKnownGen} import ch.epfl.bluebrain.nexus.delta.sdk.model.Name -import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.Anonymous -import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.User import ch.epfl.bluebrain.nexus.delta.sdk.model.search.SearchParams.{OrganizationSearchParams, ProjectSearchParams, RealmSearchParams} +import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Anonymous, User} import ch.epfl.bluebrain.nexus.delta.sourcing.model.Label -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import monix.bio.UIO -import org.scalatest.Inspectors -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike -class SearchParamsSpec extends AnyWordSpecLike with BIOValues with Matchers with Inspectors { +class SearchParamsSpec extends BioSpec { private val subject = User("myuser", Label.unsafe("myrealm")) diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/search/SearchResultsSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/search/SearchResultsSpec.scala index 666eb12924..1dd34be927 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/search/SearchResultsSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/model/search/SearchResultsSpec.scala @@ -3,10 +3,9 @@ package ch.epfl.bluebrain.nexus.delta.sdk.model.search import cats.syntax.functor._ import ch.epfl.bluebrain.nexus.delta.sdk.model.search.ResultEntry.{ScoredResultEntry, UnscoredResultEntry} import ch.epfl.bluebrain.nexus.delta.sdk.model.search.SearchResults.{ScoredSearchResults, UnscoredSearchResults} -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec -class SearchResultsSpec extends AnyWordSpecLike with Matchers { +class SearchResultsSpec extends BaseSpec { "Scored search results" should { val entries = List(ScoredResultEntry(1f, 1), ScoredResultEntry(2f, 2)) diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/organizations/OrganizationDeleterSuite.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/organizations/OrganizationDeleterSuite.scala index cf5d8829f9..ecbcdcc6a9 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/organizations/OrganizationDeleterSuite.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/organizations/OrganizationDeleterSuite.scala @@ -18,7 +18,6 @@ import ch.epfl.bluebrain.nexus.delta.sdk.projects.{ProjectsConfig, ProjectsFixtu import ch.epfl.bluebrain.nexus.delta.sourcing.PartitionInit import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.Subject import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Identity, Label, ProjectRef} -import ch.epfl.bluebrain.nexus.testkit.ce.IOFixedClock import ch.epfl.bluebrain.nexus.testkit.mu.ce.CatsEffectSuite import doobie.implicits._ import monix.bio.{IO => BIO} @@ -26,7 +25,7 @@ import munit.AnyFixture import java.util.UUID -class OrganizationDeleterSuite extends CatsEffectSuite with IOFixedClock with ConfigFixtures { +class OrganizationDeleterSuite extends CatsEffectSuite with ConfigFixtures { private val org1 = Label.unsafe("org1") private val org2 = Label.unsafe("org2") diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/organizations/OrganizationsImplSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/organizations/OrganizationsImplSpec.scala index 5e6cf80d42..d9f64198d5 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/organizations/OrganizationsImplSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/organizations/OrganizationsImplSpec.scala @@ -2,7 +2,6 @@ package ch.epfl.bluebrain.nexus.delta.sdk.organizations import ch.epfl.bluebrain.nexus.delta.kernel.search.Pagination.FromPagination import ch.epfl.bluebrain.nexus.delta.kernel.utils.UUIDF -import ch.epfl.bluebrain.nexus.delta.sdk.{ConfigFixtures, ScopeInitializationLog} import ch.epfl.bluebrain.nexus.delta.sdk.generators.OrganizationGen.{organization, resourceFor} import ch.epfl.bluebrain.nexus.delta.sdk.model.ResourceF import ch.epfl.bluebrain.nexus.delta.sdk.model.search.ResultEntry.UnscoredResultEntry @@ -10,27 +9,22 @@ import ch.epfl.bluebrain.nexus.delta.sdk.model.search.SearchParams.OrganizationS import ch.epfl.bluebrain.nexus.delta.sdk.model.search.SearchResults.UnscoredSearchResults import ch.epfl.bluebrain.nexus.delta.sdk.organizations.model.Organization import ch.epfl.bluebrain.nexus.delta.sdk.organizations.model.OrganizationRejection.{IncorrectRev, OrganizationAlreadyExists, OrganizationIsDeprecated, OrganizationNotFound, RevisionNotFound} +import ch.epfl.bluebrain.nexus.delta.sdk.{ConfigFixtures, ScopeInitializationLog} import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.Subject import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Identity, Label} import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.DoobieScalaTestFixture -import ch.epfl.bluebrain.nexus.testkit.ce.{CatsRunContext, IOFixedClock} -import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsIOValues +import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsEffectSpec import monix.bio.UIO import monix.execution.Scheduler -import org.scalatest.{CancelAfterFailure, OptionValues} -import org.scalatest.matchers.should.Matchers +import org.scalatest.CancelAfterFailure import java.time.Instant import java.util.UUID class OrganizationsImplSpec - extends DoobieScalaTestFixture - with Matchers - with CatsRunContext - with CatsIOValues - with IOFixedClock + extends CatsEffectSpec + with DoobieScalaTestFixture with CancelAfterFailure - with OptionValues with ConfigFixtures { private lazy val config = OrganizationsConfig(eventLogConfig, pagination, cacheConfig) diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/organizations/OrganizationsSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/organizations/OrganizationsSpec.scala index 241006814c..5d5569d253 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/organizations/OrganizationsSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/organizations/OrganizationsSpec.scala @@ -8,25 +8,11 @@ import ch.epfl.bluebrain.nexus.delta.sdk.organizations.model.OrganizationEvent._ import ch.epfl.bluebrain.nexus.delta.sdk.organizations.model.OrganizationRejection._ import ch.epfl.bluebrain.nexus.delta.sdk.organizations.model.OrganizationState import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.User -import ch.epfl.bluebrain.nexus.testkit.CirceLiteral -import ch.epfl.bluebrain.nexus.testkit.ce.IOFixedClock -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues -import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsIOValues -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike -import org.scalatest.{Inspectors, OptionValues} +import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsEffectSpec import java.time.Instant -class OrganizationsSpec - extends AnyWordSpecLike - with Matchers - with EitherValues - with OptionValues - with Inspectors - with CatsIOValues - with IOFixedClock - with CirceLiteral { +class OrganizationsSpec extends CatsEffectSpec { "The Organizations state machine" when { val epoch: Instant = Instant.EPOCH diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/organizations/model/OrganizationRejectionsSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/organizations/model/OrganizationRejectionsSpec.scala index f4b35673f6..df6005495c 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/organizations/model/OrganizationRejectionsSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/organizations/model/OrganizationRejectionsSpec.scala @@ -5,20 +5,9 @@ import ch.epfl.bluebrain.nexus.delta.sdk.organizations.model.OrganizationRejecti import ch.epfl.bluebrain.nexus.delta.sdk.syntax._ import ch.epfl.bluebrain.nexus.delta.sdk.utils.Fixtures import ch.epfl.bluebrain.nexus.delta.sourcing.model.Label -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues -import ch.epfl.bluebrain.nexus.testkit.{CirceLiteral, TestHelpers} -import org.scalatest.Inspectors -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec -class OrganizationRejectionsSpec - extends AnyWordSpecLike - with Matchers - with Inspectors - with CirceLiteral - with TestHelpers - with BIOValues - with Fixtures { +class OrganizationRejectionsSpec extends BioSpec with Fixtures { "An OrganizationRejection" should { diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/organizations/model/OrganizationSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/organizations/model/OrganizationSpec.scala index 7f3274b899..61ee27bc93 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/organizations/model/OrganizationSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/organizations/model/OrganizationSpec.scala @@ -4,20 +4,10 @@ import ch.epfl.bluebrain.nexus.delta.rdf.Vocabulary._ import ch.epfl.bluebrain.nexus.delta.sdk.generators.OrganizationGen import ch.epfl.bluebrain.nexus.delta.sdk.syntax._ import ch.epfl.bluebrain.nexus.delta.sdk.utils.Fixtures -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues -import ch.epfl.bluebrain.nexus.testkit.{CirceLiteral, TestHelpers} -import org.scalatest.OptionValues -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike +import ch.epfl.bluebrain.nexus.testkit.CirceLiteral +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec -class OrganizationSpec - extends AnyWordSpecLike - with Matchers - with TestHelpers - with BIOValues - with CirceLiteral - with OptionValues - with Fixtures { +class OrganizationSpec extends BioSpec with CirceLiteral with Fixtures { "An Organization" should { diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/permissions/PermissionsImplSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/permissions/PermissionsImplSpec.scala index dae4a45256..0ba333c8dd 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/permissions/PermissionsImplSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/permissions/PermissionsImplSpec.scala @@ -10,19 +10,12 @@ import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.Subject import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Identity, Label} import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.DoobieScalaTestFixture import ch.epfl.bluebrain.nexus.delta.sourcing.query.RefreshStrategy -import ch.epfl.bluebrain.nexus.testkit.ce.IOFixedClock -import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsIOValues +import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsEffectSpec import org.scalatest.CancelAfterFailure -import org.scalatest.matchers.should.Matchers import scala.concurrent.duration._ -class PermissionsImplSpec - extends DoobieScalaTestFixture - with CatsIOValues - with Matchers - with CancelAfterFailure - with IOFixedClock { +class PermissionsImplSpec extends CatsEffectSpec with DoobieScalaTestFixture with CancelAfterFailure { implicit def subject: Subject = Identity.User("user", Label.unsafe("realm")) diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/permissions/PermissionsSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/permissions/PermissionsSpec.scala index 4d73f1e756..5e27c89d1e 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/permissions/PermissionsSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/permissions/PermissionsSpec.scala @@ -6,14 +6,11 @@ import ch.epfl.bluebrain.nexus.delta.sdk.permissions.model.PermissionsEvent._ import ch.epfl.bluebrain.nexus.delta.sdk.permissions.model.PermissionsRejection._ import ch.epfl.bluebrain.nexus.delta.sdk.permissions.model._ import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Identity, Label} -import ch.epfl.bluebrain.nexus.testkit.ce.IOFixedClock -import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsIOValues -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike +import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsEffectSpec import java.time.Instant -class PermissionsSpec extends AnyWordSpecLike with Matchers with CatsIOValues with IOFixedClock { +class PermissionsSpec extends CatsEffectSpec { "The Permissions next function" should { val minimum = Set(permissions.write, permissions.read) diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/permissions/model/PermissionSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/permissions/model/PermissionSpec.scala index 7b8ae859f8..5a26d14ae0 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/permissions/model/PermissionSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/permissions/model/PermissionSpec.scala @@ -2,17 +2,13 @@ package ch.epfl.bluebrain.nexus.delta.sdk.permissions.model import ch.epfl.bluebrain.nexus.delta.sdk.error.FormatErrors.IllegalPermissionFormatError import ch.epfl.bluebrain.nexus.delta.sdk.permissions.Permissions.acls -import ch.epfl.bluebrain.nexus.testkit.TestHelpers -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec import io.circe.Json import io.circe.syntax._ -import org.scalatest.Inspectors -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike import scala.util.Random -class PermissionSpec extends AnyWordSpecLike with Matchers with Inspectors with TestHelpers with EitherValues { +class PermissionSpec extends BaseSpec { "A Permission" should { "be constructed correctly for valid strings" in { diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/permissions/model/PermissionsRejectionSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/permissions/model/PermissionsRejectionSpec.scala index 0b815ecdca..d7701e2039 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/permissions/model/PermissionsRejectionSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/permissions/model/PermissionsRejectionSpec.scala @@ -4,20 +4,10 @@ import ch.epfl.bluebrain.nexus.delta.rdf.Vocabulary.{contexts, nxv} import ch.epfl.bluebrain.nexus.delta.sdk.permissions.model.PermissionsRejection._ import ch.epfl.bluebrain.nexus.delta.sdk.syntax._ import ch.epfl.bluebrain.nexus.delta.sdk.utils.Fixtures -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues -import ch.epfl.bluebrain.nexus.testkit.{CirceLiteral, TestHelpers} -import org.scalatest.Inspectors -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike +import ch.epfl.bluebrain.nexus.testkit.CirceLiteral +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec -class PermissionsRejectionSpec - extends AnyWordSpecLike - with Matchers - with Inspectors - with CirceLiteral - with TestHelpers - with BIOValues - with Fixtures { +class PermissionsRejectionSpec extends BioSpec with CirceLiteral with Fixtures { "A PermissionsRejection" should { diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/permissions/model/PermissionsStateSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/permissions/model/PermissionsStateSpec.scala index b3c083110c..6d58aa771c 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/permissions/model/PermissionsStateSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/permissions/model/PermissionsStateSpec.scala @@ -2,12 +2,11 @@ package ch.epfl.bluebrain.nexus.delta.sdk.permissions.model import ch.epfl.bluebrain.nexus.delta.sdk.generators.PermissionsGen import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec import java.time.Instant -class PermissionsStateSpec extends AnyWordSpecLike with Matchers { +class PermissionsStateSpec extends BaseSpec { "A PermissionsState" when { diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/projects/OwnerPermissionsScopeInitializationSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/projects/OwnerPermissionsScopeInitializationSpec.scala index cc1006ebf1..db33e020f5 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/projects/OwnerPermissionsScopeInitializationSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/projects/OwnerPermissionsScopeInitializationSpec.scala @@ -9,19 +9,10 @@ import ch.epfl.bluebrain.nexus.delta.sdk.permissions.Permissions import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.User import ch.epfl.bluebrain.nexus.delta.sourcing.model.Label import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.DoobieScalaTestFixture -import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsIOValues -import ch.epfl.bluebrain.nexus.testkit.TestHelpers -import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock +import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsEffectSpec import monix.bio.UIO -import org.scalatest.matchers.should.Matchers -class OwnerPermissionsScopeInitializationSpec - extends DoobieScalaTestFixture - with Matchers - with CatsIOValues - with IOFixedClock - with TestHelpers - with ConfigFixtures { +class OwnerPermissionsScopeInitializationSpec extends CatsEffectSpec with DoobieScalaTestFixture with ConfigFixtures { private val saRealm: Label = Label.unsafe("service-accounts") private val usersRealm: Label = Label.unsafe("users") diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/projects/ProjectsImplSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/projects/ProjectsImplSpec.scala index a7d591572c..fa69ebb936 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/projects/ProjectsImplSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/projects/ProjectsImplSpec.scala @@ -17,22 +17,13 @@ import ch.epfl.bluebrain.nexus.delta.sdk.{ConfigFixtures, ScopeInitializationLog import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.Subject import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Identity, Label, ProjectRef} import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.DoobieScalaTestFixture -import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock -import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsIOValues +import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsEffectSpec import monix.bio.{IO, UIO} -import org.scalatest.matchers.should.Matchers -import org.scalatest.{CancelAfterFailure, OptionValues} +import org.scalatest.CancelAfterFailure import java.util.UUID -class ProjectsImplSpec - extends DoobieScalaTestFixture - with Matchers - with CatsIOValues - with IOFixedClock - with CancelAfterFailure - with OptionValues - with ConfigFixtures { +class ProjectsImplSpec extends CatsEffectSpec with DoobieScalaTestFixture with CancelAfterFailure with ConfigFixtures { implicit private val subject: Subject = Identity.User("user", Label.unsafe("realm")) implicit private val baseUri: BaseUri = BaseUri("http://localhost", Label.unsafe("v1")) diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/projects/ProjectsSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/projects/ProjectsSpec.scala index 76c3a34447..b021f43468 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/projects/ProjectsSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/projects/ProjectsSpec.scala @@ -12,28 +12,13 @@ import ch.epfl.bluebrain.nexus.delta.sdk.projects.model.{ApiMappings, PrefixIri} import ch.epfl.bluebrain.nexus.delta.sdk.syntax._ import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.User import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef} -import ch.epfl.bluebrain.nexus.testkit._ -import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import monix.bio.IO import monix.execution.Scheduler -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike -import org.scalatest.{Inspectors, OptionValues} import java.time.Instant -class ProjectsSpec - extends AnyWordSpecLike - with Matchers - with EitherValues - with Inspectors - with IOFixedClock - with BIOValues - with TestHelpers - with CirceLiteral - with OptionValues { +class ProjectsSpec extends BioSpec { "The Projects state machine" when { implicit val sc: Scheduler = Scheduler.global diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/projects/model/PrefixIriSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/projects/model/PrefixIriSpec.scala index f2d4db0b93..96874eed89 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/projects/model/PrefixIriSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/projects/model/PrefixIriSpec.scala @@ -2,15 +2,12 @@ package ch.epfl.bluebrain.nexus.delta.sdk.projects.model import ch.epfl.bluebrain.nexus.delta.rdf.Vocabulary._ import ch.epfl.bluebrain.nexus.delta.sdk.error.FormatErrors.{IllegalIRIFormatError, IllegalPrefixIRIFormatError} -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec import io.circe.Json import io.circe.parser._ import io.circe.syntax._ -import org.scalatest.Inspectors -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike -class PrefixIriSpec extends AnyWordSpecLike with Matchers with Inspectors with EitherValues { +class PrefixIriSpec extends BaseSpec { "A PrefixIri" should { "be an iri ending with / or #" in { diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/projects/model/ProjectFieldsSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/projects/model/ProjectFieldsSpec.scala index cdee60235e..94b812e764 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/projects/model/ProjectFieldsSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/projects/model/ProjectFieldsSpec.scala @@ -3,11 +3,9 @@ package ch.epfl.bluebrain.nexus.delta.sdk.projects.model import ch.epfl.bluebrain.nexus.delta.rdf.implicits._ import ch.epfl.bluebrain.nexus.delta.sdk.model.BaseUri import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef} -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec -class ProjectFieldsSpec extends AnyWordSpecLike with Matchers with EitherValues { +class ProjectFieldsSpec extends BaseSpec { implicit lazy val baseUri: BaseUri = BaseUri("http://localhost:8080", Label.unsafe("v1")) diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/projects/model/ProjectRejectionSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/projects/model/ProjectRejectionSpec.scala index 1d2d2de41a..54b5a6dc9b 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/projects/model/ProjectRejectionSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/projects/model/ProjectRejectionSpec.scala @@ -5,20 +5,9 @@ import ch.epfl.bluebrain.nexus.delta.sdk.projects.model.ProjectRejection._ import ch.epfl.bluebrain.nexus.delta.sdk.syntax._ import ch.epfl.bluebrain.nexus.delta.sdk.utils.Fixtures import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef} -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues -import ch.epfl.bluebrain.nexus.testkit.{CirceLiteral, TestHelpers} -import org.scalatest.Inspectors -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec -class ProjectRejectionSpec - extends AnyWordSpecLike - with Matchers - with Inspectors - with CirceLiteral - with TestHelpers - with BIOValues - with Fixtures { +class ProjectRejectionSpec extends BioSpec with Fixtures { "A ProjectRejection" should { val incorrectRev = IncorrectRev(2, 3) diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/provisioning/ProjectProvisioningSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/provisioning/ProjectProvisioningSpec.scala index 850f5ba429..16b778c22e 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/provisioning/ProjectProvisioningSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/provisioning/ProjectProvisioningSpec.scala @@ -17,21 +17,12 @@ import ch.epfl.bluebrain.nexus.delta.sdk.provisioning.ProjectProvisioning.Invali import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.Subject import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Identity, Label, ProjectRef} import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.DoobieScalaTestFixture -import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import monix.bio.{IO, UIO} -import org.scalatest.OptionValues -import org.scalatest.matchers.should.Matchers import java.util.UUID -class ProjectProvisioningSpec - extends DoobieScalaTestFixture - with Matchers - with BIOValues - with IOFixedClock - with OptionValues - with ConfigFixtures { +class ProjectProvisioningSpec extends BioSpec with DoobieScalaTestFixture with ConfigFixtures { implicit private val baseUri: BaseUri = BaseUri("http://localhost", Label.unsafe("v1")) diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/quotas/QuotasImplSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/quotas/QuotasImplSpec.scala index f242055e61..01a9d9b110 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/quotas/QuotasImplSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/quotas/QuotasImplSpec.scala @@ -1,6 +1,5 @@ package ch.epfl.bluebrain.nexus.delta.sdk.quotas -import ch.epfl.bluebrain.nexus.delta.sdk.ConfigFixtures import ch.epfl.bluebrain.nexus.delta.sdk.identities.model.ServiceAccount import ch.epfl.bluebrain.nexus.delta.sdk.model.ServiceAccountConfig import ch.epfl.bluebrain.nexus.delta.sdk.projects.ProjectsStatistics @@ -11,14 +10,12 @@ import ch.epfl.bluebrain.nexus.delta.sdk.quotas.model.QuotaRejection.QuotaReache import ch.epfl.bluebrain.nexus.delta.sdk.quotas.model.QuotaRejection.QuotasDisabled import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Anonymous, User} import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef} -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import monix.bio.UIO -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike import java.time.Instant -class QuotasImplSpec extends AnyWordSpecLike with Matchers with BIOValues with ConfigFixtures { +class QuotasImplSpec extends BioSpec { private val project = ProjectRef.unsafe("myorg", "myproject") private val project2 = ProjectRef.unsafe("myorg", "myproject2") diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/realms/RealmsEvaluateSuite.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/realms/RealmsEvaluateSuite.scala index c6034cb9f7..cf320b6f76 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/realms/RealmsEvaluateSuite.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/realms/RealmsEvaluateSuite.scala @@ -10,12 +10,12 @@ import ch.epfl.bluebrain.nexus.delta.sdk.realms.model.RealmEvent._ import ch.epfl.bluebrain.nexus.delta.sdk.realms.model.RealmRejection._ import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.User import ch.epfl.bluebrain.nexus.delta.sourcing.model.Label -import ch.epfl.bluebrain.nexus.testkit.ce.{IOFixedClock, IOFromMap} +import ch.epfl.bluebrain.nexus.testkit.ce.IOFromMap import ch.epfl.bluebrain.nexus.testkit.mu.ce.CatsEffectSuite import java.time.Instant -class RealmsEvaluateSuite extends CatsEffectSuite with IOFromMap with IOFixedClock { +class RealmsEvaluateSuite extends CatsEffectSuite with IOFromMap { private val epoch: Instant = Instant.EPOCH private val issuer: String = "myrealm" diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/realms/model/RealmsRejectionSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/realms/model/RealmsRejectionSpec.scala index 26a6c0fb55..f7dc61c405 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/realms/model/RealmsRejectionSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/realms/model/RealmsRejectionSpec.scala @@ -5,20 +5,10 @@ import ch.epfl.bluebrain.nexus.delta.sdk.realms.model.RealmRejection.{IncorrectR import ch.epfl.bluebrain.nexus.delta.sdk.syntax._ import ch.epfl.bluebrain.nexus.delta.sdk.utils.Fixtures import ch.epfl.bluebrain.nexus.delta.sourcing.model.Label -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues -import ch.epfl.bluebrain.nexus.testkit.{CirceLiteral, TestHelpers} -import org.scalatest.Inspectors -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike +import ch.epfl.bluebrain.nexus.testkit.CirceLiteral +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec -class RealmsRejectionSpec - extends AnyWordSpecLike - with Matchers - with Inspectors - with CirceLiteral - with TestHelpers - with BIOValues - with Fixtures { +class RealmsRejectionSpec extends BioSpec with CirceLiteral with Fixtures { "A RealmsRejection" should { diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/resolvers/ResolversEvaluateSuite.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/resolvers/ResolversEvaluateSuite.scala index b67d3c2d53..3990734a65 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/resolvers/ResolversEvaluateSuite.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/resolvers/ResolversEvaluateSuite.scala @@ -13,11 +13,10 @@ import ch.epfl.bluebrain.nexus.delta.sdk.resolvers.model.ResolverType.{CrossProj import ch.epfl.bluebrain.nexus.delta.sdk.resolvers.model.ResolverValue.{CrossProjectValue, InProjectValue} import ch.epfl.bluebrain.nexus.delta.sourcing.model.ProjectRef import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag -import ch.epfl.bluebrain.nexus.testkit.ce.IOFixedClock import ch.epfl.bluebrain.nexus.testkit.mu.ce.CatsEffectSuite import io.circe.Json -class ResolversEvaluateSuite extends CatsEffectSuite with IOFixedClock with ResolverStateMachineFixture { +class ResolversEvaluateSuite extends CatsEffectSuite with ResolverStateMachineFixture { private val validatePriority: ValidatePriority = (_, _, _) => IO.unit diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/resolvers/ResolversImplSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/resolvers/ResolversImplSpec.scala index 67c8db09a7..eb70e2e47d 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/resolvers/ResolversImplSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/resolvers/ResolversImplSpec.scala @@ -27,24 +27,18 @@ import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Authenticated, Gro import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef} import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.DoobieScalaTestFixture -import ch.epfl.bluebrain.nexus.testkit.CirceLiteral -import ch.epfl.bluebrain.nexus.testkit.ce.IOFixedClock +import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BioSpec import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsIOValues import monix.bio.UIO -import org.scalatest.matchers.should.Matchers -import org.scalatest.{CancelAfterFailure, Inspectors, OptionValues} +import org.scalatest.CancelAfterFailure import java.util.UUID class ResolversImplSpec - extends DoobieScalaTestFixture + extends BioSpec + with DoobieScalaTestFixture with CatsIOValues - with Matchers - with IOFixedClock with CancelAfterFailure - with CirceLiteral - with Inspectors - with OptionValues with ConfigFixtures { private val realm = Label.unsafe("myrealm") diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/resolvers/model/PrioritySpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/resolvers/model/PrioritySpec.scala index 4d213ea019..b64255015c 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/resolvers/model/PrioritySpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/resolvers/model/PrioritySpec.scala @@ -1,12 +1,9 @@ package ch.epfl.bluebrain.nexus.delta.sdk.resolvers.model import ch.epfl.bluebrain.nexus.delta.sdk.error.FormatErrors.ResolverPriorityIntervalError -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues -import org.scalatest.Inspectors -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec -class PrioritySpec extends AnyWordSpecLike with Matchers with Inspectors with EitherValues { +class PrioritySpec extends BaseSpec { "A priority" should { diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/resolvers/model/ResolverValueSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/resolvers/model/ResolverValueSpec.scala index 54fa656066..1189b62260 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/resolvers/model/ResolverValueSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/resolvers/model/ResolverValueSpec.scala @@ -9,21 +9,9 @@ import ch.epfl.bluebrain.nexus.delta.sdk.resolvers.model.ResolverValue.{CrossPro import ch.epfl.bluebrain.nexus.delta.sdk.utils.Fixtures import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Authenticated, Group, User} import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef} -import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsIOValues -import ch.epfl.bluebrain.nexus.testkit.TestHelpers -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues -import org.scalatest.Inspectors -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike - -class ResolverValueSpec - extends AnyWordSpecLike - with Matchers - with EitherValues - with CatsIOValues - with Inspectors - with TestHelpers - with Fixtures { +import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsEffectSpec + +class ResolverValueSpec extends CatsEffectSpec with Fixtures { private val realm = Label.unsafe("myrealm") private val name = Some("resolverName") diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/resources/ResourcesImplSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/resources/ResourcesImplSpec.scala index 5ffc6edab3..5161a5ae6b 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/resources/ResourcesImplSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/resources/ResourcesImplSpec.scala @@ -27,22 +27,16 @@ import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Identity, Label, ProjectRef, ResourceRef} import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.DoobieScalaTestFixture import ch.epfl.bluebrain.nexus.testkit.CirceLiteral -import ch.epfl.bluebrain.nexus.testkit.ce.IOFixedClock -import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsIOValues -import org.scalatest.matchers.should.Matchers -import org.scalatest.{CancelAfterFailure, Inspectors, OptionValues} +import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsEffectSpec +import org.scalatest.CancelAfterFailure import java.util.UUID class ResourcesImplSpec - extends DoobieScalaTestFixture - with Matchers - with CatsIOValues - with IOFixedClock + extends CatsEffectSpec + with DoobieScalaTestFixture with CancelAfterFailure with CirceLiteral - with Inspectors - with OptionValues with ConfigFixtures { implicit private val subject: Subject = Identity.User("user", Label.unsafe("realm")) diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/resources/ResourcesSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/resources/ResourcesSpec.scala index 2fc88740a1..3578189ad4 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/resources/ResourcesSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/resources/ResourcesSpec.scala @@ -15,36 +15,18 @@ import ch.epfl.bluebrain.nexus.delta.sdk.resources.model.ResourceCommand._ import ch.epfl.bluebrain.nexus.delta.sdk.resources.model.ResourceEvent._ import ch.epfl.bluebrain.nexus.delta.sdk.resources.model.ResourceRejection.{IncorrectRev, ResourceIsDeprecated, ResourceNotFound, RevisionNotFound} import ch.epfl.bluebrain.nexus.delta.sdk.resources.model.{ResourceCommand, ResourceEvent, ResourceState} -import ch.epfl.bluebrain.nexus.delta.sdk.utils.Fixtures import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.User import ch.epfl.bluebrain.nexus.delta.sourcing.model.Label import ch.epfl.bluebrain.nexus.delta.sourcing.model.ResourceRef.{Latest, Revision} import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag -import ch.epfl.bluebrain.nexus.testkit.ce.IOFixedClock -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues -import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsIOValues -import ch.epfl.bluebrain.nexus.testkit.{CirceLiteral, TestHelpers} +import ch.epfl.bluebrain.nexus.testkit.CirceLiteral +import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsEffectSpec import io.circe.Json import io.circe.syntax.{EncoderOps, KeyOps} -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike -import org.scalatest.{Inspectors, OptionValues} import java.time.Instant -class ResourcesSpec - extends AnyWordSpecLike - with Matchers - with EitherValues - with Inspectors - with IOFixedClock - with CatsIOValues - with TestHelpers - with CirceLiteral - with OptionValues - with ValidateResourceFixture - with ResourceInstanceFixture - with Fixtures { +class ResourcesSpec extends CatsEffectSpec with CirceLiteral with ValidateResourceFixture with ResourceInstanceFixture { "The Resources state machine" when { val epoch = Instant.EPOCH diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/schemas/SchemasImplSuite.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/schemas/SchemasImplSuite.scala index d1950ac4cc..36a3ba2307 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/schemas/SchemasImplSuite.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/schemas/SchemasImplSuite.scala @@ -19,7 +19,6 @@ import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.Subject import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Identity, Label, ProjectRef} import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.Doobie -import ch.epfl.bluebrain.nexus.testkit.ce.IOFixedClock import ch.epfl.bluebrain.nexus.testkit.mu.ce.CatsEffectSuite import ch.epfl.bluebrain.nexus.testkit.{CirceLiteral, TestHelpers} import munit.AnyFixture @@ -29,7 +28,6 @@ import java.util.UUID class SchemasImplSuite extends CatsEffectSuite with Doobie.Fixture - with IOFixedClock with CirceLiteral with ConfigFixtures with TestHelpers { diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/schemas/SchemasSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/schemas/SchemasSpec.scala index 77ba478c96..4e8634251a 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/schemas/SchemasSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/schemas/SchemasSpec.scala @@ -14,11 +14,10 @@ import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.User import ch.epfl.bluebrain.nexus.delta.sourcing.model.Label import ch.epfl.bluebrain.nexus.delta.sourcing.model.Tag.UserTag import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.CatsEffectSpec -import ch.epfl.bluebrain.nexus.testkit.{CirceLiteral, TestHelpers} import java.time.Instant -class SchemasSpec extends CatsEffectSpec with TestHelpers with CirceLiteral with Fixtures { +class SchemasSpec extends CatsEffectSpec with Fixtures { implicit override val api: JsonLdApi = JsonLdJavaApi.lenient diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/sse/SseEventLogSuite.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/sse/SseEventLogSuite.scala index 57e795c57a..f318da4a9a 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/sse/SseEventLogSuite.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/sse/SseEventLogSuite.scala @@ -8,7 +8,6 @@ import ch.epfl.bluebrain.nexus.delta.sdk.ConfigFixtures import ch.epfl.bluebrain.nexus.delta.sdk.sse.SseEncoder.SseData import ch.epfl.bluebrain.nexus.delta.sourcing.model.{EntityType, Envelope, ProjectRef} import ch.epfl.bluebrain.nexus.delta.sourcing.offset.Offset -import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock import ch.epfl.bluebrain.nexus.testkit.mu.bio.BioSuite import ch.epfl.bluebrain.nexus.testkit.mu.ce.CatsEffectMUnitAssertions import io.circe.JsonObject @@ -17,7 +16,7 @@ import io.circe.syntax.EncoderOps import java.time.Instant import java.util.UUID -class SseEventLogSuite extends BioSuite with ConfigFixtures with IOFixedClock with CatsEffectMUnitAssertions { +class SseEventLogSuite extends BioSuite with ConfigFixtures with CatsEffectMUnitAssertions { implicit private val jo: JsonKeyOrdering = JsonKeyOrdering.alphabetical diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/utils/BaseRouteSpec.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/utils/BaseRouteSpec.scala index f311fdf29b..9c073e56f4 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/utils/BaseRouteSpec.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/utils/BaseRouteSpec.scala @@ -3,10 +3,8 @@ package ch.epfl.bluebrain.nexus.delta.sdk.utils import ch.epfl.bluebrain.nexus.delta.sdk.ConfigFixtures import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.DoobieScalaTestFixture import ch.epfl.bluebrain.nexus.testkit._ -import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock import ch.epfl.bluebrain.nexus.testkit.ce.CatsRunContext import ch.epfl.bluebrain.nexus.testkit.scalatest.TestMatchers -import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues import org.scalatest.matchers.should.Matchers import org.scalatest.{Inspectors, OptionValues} @@ -17,8 +15,6 @@ trait BaseRouteSpec with Matchers with CirceLiteral with CirceEq - with IOFixedClock - with BIOValues with OptionValues with TestMatchers with Inspectors diff --git a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/utils/RouteHelpers.scala b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/utils/RouteHelpers.scala index 50f74607e9..d2d6bab8c7 100644 --- a/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/utils/RouteHelpers.scala +++ b/delta/sdk/src/test/scala/ch/epfl/bluebrain/nexus/delta/sdk/utils/RouteHelpers.scala @@ -8,18 +8,19 @@ import akka.stream.Materializer import akka.stream.scaladsl.Source import akka.testkit.TestDuration import akka.util.ByteString -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec import io.circe.parser.parse import io.circe.{Decoder, Json, JsonObject, Printer} +import org.scalatest.Suite import org.scalatest.concurrent.ScalaFutures import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike import java.nio.charset.StandardCharsets import scala.concurrent.duration._ import scala.reflect.ClassTag -trait RouteHelpers extends AnyWordSpecLike with ScalatestRouteTest with ScalaFutures with EitherValues { +trait RouteHelpers extends BaseSpec with ScalatestRouteTest with ScalaFutures { + self: Suite => implicit val routeTimeout: RouteTestTimeout = RouteTestTimeout(6.seconds.dilated) diff --git a/delta/sourcing-psql/src/test/scala/ch/epfl/bluebrain/nexus/delta/sourcing/postgres/DoobieScalaTestFixture.scala b/delta/sourcing-psql/src/test/scala/ch/epfl/bluebrain/nexus/delta/sourcing/postgres/DoobieScalaTestFixture.scala index 0bef88bf5a..5e71305d69 100644 --- a/delta/sourcing-psql/src/test/scala/ch/epfl/bluebrain/nexus/delta/sourcing/postgres/DoobieScalaTestFixture.scala +++ b/delta/sourcing-psql/src/test/scala/ch/epfl/bluebrain/nexus/delta/sourcing/postgres/DoobieScalaTestFixture.scala @@ -2,18 +2,20 @@ package ch.epfl.bluebrain.nexus.delta.sourcing.postgres import ch.epfl.bluebrain.nexus.delta.sourcing.Transactors import ch.epfl.bluebrain.nexus.testkit.TestHelpers +import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock import ch.epfl.bluebrain.nexus.testkit.scalatest.bio.BIOValues import monix.bio.Task import monix.execution.Scheduler -import org.scalatest.BeforeAndAfterAll -import org.scalatest.wordspec.AnyWordSpecLike +import org.scalatest.{BeforeAndAfterAll, Suite} trait DoobieScalaTestFixture - extends AnyWordSpecLike - with BeforeAndAfterAll + extends BeforeAndAfterAll with PostgresDocker with TestHelpers - with BIOValues { + with BIOValues + with IOFixedClock { + + self: Suite => implicit val classLoader: ClassLoader = getClass.getClassLoader diff --git a/delta/sourcing-psql/src/test/scala/ch/epfl/bluebrain/nexus/delta/sourcing/projections/ProjectionRestartStoreSuite.scala b/delta/sourcing-psql/src/test/scala/ch/epfl/bluebrain/nexus/delta/sourcing/projections/ProjectionRestartStoreSuite.scala index 32e844edef..2fe026757c 100644 --- a/delta/sourcing-psql/src/test/scala/ch/epfl/bluebrain/nexus/delta/sourcing/projections/ProjectionRestartStoreSuite.scala +++ b/delta/sourcing-psql/src/test/scala/ch/epfl/bluebrain/nexus/delta/sourcing/projections/ProjectionRestartStoreSuite.scala @@ -3,18 +3,17 @@ package ch.epfl.bluebrain.nexus.delta.sourcing.projections import ch.epfl.bluebrain.nexus.delta.sourcing.config.QueryConfig import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.Anonymous import ch.epfl.bluebrain.nexus.delta.sourcing.offset.Offset +import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.Doobie import ch.epfl.bluebrain.nexus.delta.sourcing.projections.model.ProjectionRestart import ch.epfl.bluebrain.nexus.delta.sourcing.projections.model.ProjectionRestart.{entityType, restartId} import ch.epfl.bluebrain.nexus.delta.sourcing.query.RefreshStrategy import ch.epfl.bluebrain.nexus.delta.sourcing.stream.Elem.SuccessElem -import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock -import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.Doobie import ch.epfl.bluebrain.nexus.testkit.mu.bio.BioSuite import munit.AnyFixture import java.time.Instant -class ProjectionRestartStoreSuite extends BioSuite with IOFixedClock with Doobie.Fixture with Doobie.Assertions { +class ProjectionRestartStoreSuite extends BioSuite with Doobie.Fixture with Doobie.Assertions { override def munitFixtures: Seq[AnyFixture[_]] = List(doobie) diff --git a/delta/sourcing-psql/src/test/scala/ch/epfl/bluebrain/nexus/delta/sourcing/state/EphemeralStateStoreSuite.scala b/delta/sourcing-psql/src/test/scala/ch/epfl/bluebrain/nexus/delta/sourcing/state/EphemeralStateStoreSuite.scala index 3c18d5bd1f..88e1755857 100644 --- a/delta/sourcing-psql/src/test/scala/ch/epfl/bluebrain/nexus/delta/sourcing/state/EphemeralStateStoreSuite.scala +++ b/delta/sourcing-psql/src/test/scala/ch/epfl/bluebrain/nexus/delta/sourcing/state/EphemeralStateStoreSuite.scala @@ -2,12 +2,12 @@ package ch.epfl.bluebrain.nexus.delta.sourcing.state import ch.epfl.bluebrain.nexus.delta.rdf.IriOrBNode.Iri import ch.epfl.bluebrain.nexus.delta.rdf.Vocabulary.nxv -import ch.epfl.bluebrain.nexus.delta.sourcing.{DeleteExpired, Message} import ch.epfl.bluebrain.nexus.delta.sourcing.Message.MessageState import ch.epfl.bluebrain.nexus.delta.sourcing.model.Identity.{Anonymous, User} import ch.epfl.bluebrain.nexus.delta.sourcing.model.{Label, ProjectRef} import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.Doobie -import ch.epfl.bluebrain.nexus.testkit.ce.IOFixedClock +import ch.epfl.bluebrain.nexus.delta.sourcing.{DeleteExpired, Message} +import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock import ch.epfl.bluebrain.nexus.testkit.mu.ce.CatsEffectSuite import doobie.implicits._ import munit.AnyFixture diff --git a/delta/sourcing-psql/src/test/scala/ch/epfl/bluebrain/nexus/delta/sourcing/stream/ProjectionStoreSuite.scala b/delta/sourcing-psql/src/test/scala/ch/epfl/bluebrain/nexus/delta/sourcing/stream/ProjectionStoreSuite.scala index e6bd5776c0..034fcbb886 100644 --- a/delta/sourcing-psql/src/test/scala/ch/epfl/bluebrain/nexus/delta/sourcing/stream/ProjectionStoreSuite.scala +++ b/delta/sourcing-psql/src/test/scala/ch/epfl/bluebrain/nexus/delta/sourcing/stream/ProjectionStoreSuite.scala @@ -6,13 +6,12 @@ import ch.epfl.bluebrain.nexus.delta.sourcing.model.ProjectRef import ch.epfl.bluebrain.nexus.delta.sourcing.offset.Offset import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.Doobie import ch.epfl.bluebrain.nexus.delta.sourcing.query.RefreshStrategy -import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock import ch.epfl.bluebrain.nexus.testkit.mu.bio.BioSuite import munit.AnyFixture import java.time.Instant -class ProjectionStoreSuite extends BioSuite with IOFixedClock with Doobie.Fixture with Doobie.Assertions { +class ProjectionStoreSuite extends BioSuite with Doobie.Fixture with Doobie.Assertions { override def munitFixtures: Seq[AnyFixture[_]] = List(doobie) @@ -75,7 +74,7 @@ class ProjectionStoreSuite extends BioSuite with IOFixedClock with Doobie.Fixtur test("Reset an offset") { val later = Instant.EPOCH.plusSeconds(1000) - val storeLater = ProjectionStore(xas, QueryConfig(10, RefreshStrategy.Stop))(ioClock(later)) + val storeLater = ProjectionStore(xas, QueryConfig(10, RefreshStrategy.Stop))(bioClock(later)) for { _ <- store.save(metadata, progress) diff --git a/delta/testkit/src/main/scala/ch/epfl/bluebrain/nexus/testkit/bio/IOFixedClock.scala b/delta/testkit/src/main/scala/ch/epfl/bluebrain/nexus/testkit/bio/IOFixedClock.scala index 3a60bc6b80..9a036851a3 100644 --- a/delta/testkit/src/main/scala/ch/epfl/bluebrain/nexus/testkit/bio/IOFixedClock.scala +++ b/delta/testkit/src/main/scala/ch/epfl/bluebrain/nexus/testkit/bio/IOFixedClock.scala @@ -1,19 +1,27 @@ package ch.epfl.bluebrain.nexus.testkit.bio -import cats.effect.Clock -import monix.bio.{IO, UIO} +import cats.effect.{Clock, IO} +import monix.bio.UIO import java.time.Instant import scala.concurrent.duration.TimeUnit trait IOFixedClock { - def ioClock(instant: Instant): Clock[UIO] = new Clock[UIO] { - override def realTime(unit: TimeUnit): UIO[Long] = IO.pure(instant.toEpochMilli) - override def monotonic(unit: TimeUnit): UIO[Long] = IO.pure(instant.toEpochMilli) + def bioClock(instant: Instant): Clock[UIO] = new Clock[UIO] { + override def realTime(unit: TimeUnit): UIO[Long] = UIO.pure(instant.toEpochMilli) + override def monotonic(unit: TimeUnit): UIO[Long] = UIO.pure(instant.toEpochMilli) } - implicit def ioClock: Clock[UIO] = ioClock(Instant.EPOCH) + implicit def bioClock: Clock[UIO] = bioClock(Instant.EPOCH) + + def ceClock(instant: Instant): Clock[IO] = new Clock[IO] { + override def realTime(unit: TimeUnit): IO[Long] = IO.pure(instant.toEpochMilli) + + override def monotonic(unit: TimeUnit): IO[Long] = IO.pure(instant.toEpochMilli) + } + + implicit def ceClock: Clock[IO] = ceClock(Instant.EPOCH) } object IOFixedClock extends IOFixedClock diff --git a/delta/testkit/src/main/scala/ch/epfl/bluebrain/nexus/testkit/ce/IOFixedClock.scala b/delta/testkit/src/main/scala/ch/epfl/bluebrain/nexus/testkit/ce/IOFixedClock.scala deleted file mode 100644 index 8e3f44e266..0000000000 --- a/delta/testkit/src/main/scala/ch/epfl/bluebrain/nexus/testkit/ce/IOFixedClock.scala +++ /dev/null @@ -1,18 +0,0 @@ -package ch.epfl.bluebrain.nexus.testkit.ce - -import java.time.Instant -import cats.effect.{Clock, IO} - -import scala.concurrent.duration.TimeUnit - -trait IOFixedClock { - - def ceClock(instant: Instant): Clock[IO] = new Clock[IO] { - override def realTime(unit: TimeUnit): IO[Long] = IO.pure(instant.toEpochMilli) - override def monotonic(unit: TimeUnit): IO[Long] = IO.pure(instant.toEpochMilli) - } - - implicit def ceClock: Clock[IO] = ceClock(Instant.EPOCH) -} - -object IOFixedClock extends IOFixedClock diff --git a/delta/testkit/src/main/scala/ch/epfl/bluebrain/nexus/testkit/mu/ce/CatsEffectSuite.scala b/delta/testkit/src/main/scala/ch/epfl/bluebrain/nexus/testkit/mu/ce/CatsEffectSuite.scala index 7f465825e7..149739ea3d 100644 --- a/delta/testkit/src/main/scala/ch/epfl/bluebrain/nexus/testkit/mu/ce/CatsEffectSuite.scala +++ b/delta/testkit/src/main/scala/ch/epfl/bluebrain/nexus/testkit/mu/ce/CatsEffectSuite.scala @@ -1,7 +1,8 @@ package ch.epfl.bluebrain.nexus.testkit.mu.ce import cats.effect.IO -import ch.epfl.bluebrain.nexus.testkit.ce.{CatsRunContext, IOFixedClock} +import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock +import ch.epfl.bluebrain.nexus.testkit.ce.CatsRunContext import ch.epfl.bluebrain.nexus.testkit.mu.{CollectionAssertions, EitherAssertions, EitherValues, NexusSuite} import monix.bio.{IO => BIO} import monix.execution.Scheduler diff --git a/delta/testkit/src/main/scala/ch/epfl/bluebrain/nexus/testkit/scalatest/bio/BioSpec.scala b/delta/testkit/src/main/scala/ch/epfl/bluebrain/nexus/testkit/scalatest/bio/BioSpec.scala index 0d333e5f6b..2ccc32243a 100644 --- a/delta/testkit/src/main/scala/ch/epfl/bluebrain/nexus/testkit/scalatest/bio/BioSpec.scala +++ b/delta/testkit/src/main/scala/ch/epfl/bluebrain/nexus/testkit/scalatest/bio/BioSpec.scala @@ -1,5 +1,6 @@ package ch.epfl.bluebrain.nexus.testkit.scalatest.bio +import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec -trait BioSpec extends BaseSpec with BIOValues +trait BioSpec extends BaseSpec with BIOValues with IOFixedClock diff --git a/delta/testkit/src/main/scala/ch/epfl/bluebrain/nexus/testkit/scalatest/ce/CatsEffectSpec.scala b/delta/testkit/src/main/scala/ch/epfl/bluebrain/nexus/testkit/scalatest/ce/CatsEffectSpec.scala index b307968987..afbf2d933e 100644 --- a/delta/testkit/src/main/scala/ch/epfl/bluebrain/nexus/testkit/scalatest/ce/CatsEffectSpec.scala +++ b/delta/testkit/src/main/scala/ch/epfl/bluebrain/nexus/testkit/scalatest/ce/CatsEffectSpec.scala @@ -1,6 +1,7 @@ package ch.epfl.bluebrain.nexus.testkit.scalatest.ce -import ch.epfl.bluebrain.nexus.testkit.ce.{CatsRunContext, IOFixedClock} +import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock +import ch.epfl.bluebrain.nexus.testkit.ce.CatsRunContext import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec abstract class CatsEffectSpec extends BaseSpec with CatsRunContext with CatsIOValues with IOFixedClock diff --git a/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/DiskStorageSpec.scala b/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/DiskStorageSpec.scala index 134942db1f..6343a2e651 100644 --- a/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/DiskStorageSpec.scala +++ b/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/DiskStorageSpec.scala @@ -60,7 +60,7 @@ class DiskStorageSpec } trait AbsoluteDirectoryCreated { - val name = genString() + val name = randomString() val baseRootPath = rootPath.resolve(name) val basePath = baseRootPath.resolve(sConfig.protectedDirectory) Files.createDirectories(rootPath.resolve(name).resolve(sConfig.protectedDirectory)) @@ -68,7 +68,7 @@ class DiskStorageSpec } trait RelativeDirectoryCreated extends AbsoluteDirectoryCreated { - val relativeDir = s"some/${genString()}" + val relativeDir = s"some/${randomString()}" val absoluteDir = basePath.resolve(relativeDir) val relativeFileString = s"$relativeDir/file.txt" val relativeFilePath = Uri.Path(relativeFileString) @@ -83,12 +83,12 @@ class DiskStorageSpec "checking storage" should { "fail when bucket directory does not exists" in { - val name = genString() + val name = randomString() storage.exists(name) shouldBe a[BucketDoesNotExist] } "fail when bucket is not a directory" in { - val name = genString() + val name = randomString() val directory = Files.createDirectories(rootPath.resolve(name)) Files.createFile(directory.resolve(sConfig.protectedDirectory)) storage.exists(name) shouldBe a[BucketDoesNotExist] @@ -174,13 +174,13 @@ class DiskStorageSpec Files.write(absoluteFile, "something".getBytes(StandardCharsets.UTF_8)) badStorage - .moveFile(name, Uri.Path(file), Uri.Path(genString())) + .moveFile(name, Uri.Path(file), Uri.Path(randomString())) .failed[StorageError] shouldEqual PermissionsFixingFailed(absoluteFile.toString, "") } "fail when source does not exists" in new AbsoluteDirectoryCreated { - val source = genString() - storage.moveFile(name, Uri.Path(source), Uri.Path(genString())).rejected[PathNotFound] shouldEqual + val source = randomString() + storage.moveFile(name, Uri.Path(source), Uri.Path(randomString())).rejected[PathNotFound] shouldEqual PathNotFound(name, Uri.Path(source)) } @@ -190,7 +190,7 @@ class DiskStorageSpec Files.createDirectories(absoluteFile.getParent) Files.write(absoluteFile, "something".getBytes(StandardCharsets.UTF_8)) - storage.moveFile(name, Uri.Path(file), Uri.Path(genString())).rejected[PathNotFound] shouldEqual + storage.moveFile(name, Uri.Path(file), Uri.Path(randomString())).rejected[PathNotFound] shouldEqual PathNotFound(name, Uri.Path(file)) } @@ -379,7 +379,7 @@ class DiskStorageSpec val expectedAttributes = FileAttributes( s"file://$absoluteFilePath", content.size.toLong, - Digest(alg, genString()), + Digest(alg, randomString()), `text/plain(UTF-8)` ) cache.get(absoluteFilePath) shouldReturn IO(expectedAttributes) diff --git a/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/StringProcessLoggerSpec.scala b/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/StringProcessLoggerSpec.scala index 638a1c8030..e16dec2253 100644 --- a/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/StringProcessLoggerSpec.scala +++ b/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/StringProcessLoggerSpec.scala @@ -1,11 +1,10 @@ package ch.epfl.bluebrain.nexus.storage -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec import scala.sys.process._ -class StringProcessLoggerSpec extends AnyWordSpecLike with Matchers { +class StringProcessLoggerSpec extends BaseSpec { "A StringProcessLogger" should { "log stdout" in { val cmd = List("echo", "-n", "Hello", "world!") diff --git a/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/TarFlowSpec.scala b/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/TarFlowSpec.scala index 29ec94da9a..cbb2663aa2 100644 --- a/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/TarFlowSpec.scala +++ b/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/TarFlowSpec.scala @@ -47,11 +47,11 @@ class TarFlowSpec "generate the byteString for a tar file correctly" in { val file1 = dir1.resolve("file1.txt") - val file1Content = genString() + val file1Content = randomString() val file2 = dir1.resolve("file3.txt") - val file2Content = genString() + val file2Content = randomString() val file3 = dir2.resolve("file3.txt") - val file3Content = genString() + val file3Content = randomString() val files = List(file1 -> file1Content, file2 -> file2Content, file3 -> file3Content) forAll(files) { case (file, content) => Source.single(ByteString(content)).runWith(FileIO.toPath(file)).futureValue diff --git a/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/attributes/AttributesCacheSpec.scala b/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/attributes/AttributesCacheSpec.scala index 7b57e639da..8466cf1ff1 100644 --- a/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/attributes/AttributesCacheSpec.scala +++ b/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/attributes/AttributesCacheSpec.scala @@ -46,8 +46,8 @@ class AttributesCacheSpec } trait Ctx { - val path: Path = Paths.get(genString()) - val digest = Digest(config.algorithm, genString()) + val path: Path = Paths.get(randomString()) + val digest = Digest(config.algorithm, randomString()) val attributes = FileAttributes(s"file://$path", genInt().toLong, digest, `image/jpeg`) def attributesEmpty(p: Path = path) = FileAttributes(p.toAkkaUri, 0L, Digest.empty, `application/octet-stream`) val counter = new AtomicInteger(0) diff --git a/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/auth/AuthorizationMethodSuite.scala b/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/auth/AuthorizationMethodSuite.scala index 31be7bdc4a..96dfa8c593 100644 --- a/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/auth/AuthorizationMethodSuite.scala +++ b/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/auth/AuthorizationMethodSuite.scala @@ -1,6 +1,6 @@ package ch.epfl.bluebrain.nexus.storage.auth -import ch.epfl.bluebrain.nexus.storage.utils.Randomness.genString +import ch.epfl.bluebrain.nexus.storage.utils.Randomness.randomString import cats.data.NonEmptySet import ch.epfl.bluebrain.nexus.storage.auth.AuthorizationMethod._ import com.nimbusds.jose.jwk.gen.RSAKeyGenerator @@ -12,7 +12,7 @@ import scala.jdk.CollectionConverters._ class AuthorizationMethodSuite extends FunSuite { - private def generateKey: RSAKey = new RSAKeyGenerator(2048).keyID(genString()).generate() + private def generateKey: RSAKey = new RSAKeyGenerator(2048).keyID(randomString()).generate() private def parseConfig(value: String) = ConfigSource.string(value).at("authorization").load[AuthorizationMethod] diff --git a/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/routes/AppInfoRoutesSpec.scala b/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/routes/AppInfoRoutesSpec.scala index cc7f40d0d5..791348609d 100644 --- a/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/routes/AppInfoRoutesSpec.scala +++ b/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/routes/AppInfoRoutesSpec.scala @@ -9,19 +9,13 @@ import ch.epfl.bluebrain.nexus.storage.config.{AppConfig, Settings} import ch.epfl.bluebrain.nexus.storage.routes.instances._ import ch.epfl.bluebrain.nexus.storage.utils.Resources import ch.epfl.bluebrain.nexus.storage.{AkkaSource, Storages} +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec import io.circe.Json import org.mockito.IdiomaticMockito -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike import java.util.regex.Pattern.quote -class AppInfoRoutesSpec - extends AnyWordSpecLike - with Matchers - with ScalatestRouteTest - with IdiomaticMockito - with Resources { +class AppInfoRoutesSpec extends BaseSpec with ScalatestRouteTest with IdiomaticMockito with Resources { "the app info routes" should { diff --git a/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/routes/AuthDirectivesSpec.scala b/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/routes/AuthDirectivesSpec.scala index 3b815be440..4b5ad908fb 100644 --- a/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/routes/AuthDirectivesSpec.scala +++ b/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/routes/AuthDirectivesSpec.scala @@ -9,18 +9,16 @@ import ch.epfl.bluebrain.nexus.storage.auth.AuthorizationMethod.VerifyToken import ch.epfl.bluebrain.nexus.storage.config.AppConfig.HttpConfig import ch.epfl.bluebrain.nexus.storage.config.Settings import ch.epfl.bluebrain.nexus.storage.routes.AuthDirectives._ -import ch.epfl.bluebrain.nexus.storage.utils.Randomness.genString import ch.epfl.bluebrain.nexus.testkit.jwt.TokenGenerator +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec import com.nimbusds.jose.jwk.gen.RSAKeyGenerator import com.nimbusds.jose.jwk.{JWKSet, RSAKey} import org.scalatest.BeforeAndAfter -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike import java.time.Instant //noinspection NameBooleanParameters -class AuthDirectivesSpec extends AnyWordSpecLike with Matchers with BeforeAndAfter with ScalatestRouteTest { +class AuthDirectivesSpec extends BaseSpec with BeforeAndAfter with ScalatestRouteTest { implicit private val hc: HttpConfig = Settings(system).appConfig.http diff --git a/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/routes/StorageDirectivesSpec.scala b/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/routes/StorageDirectivesSpec.scala index 23db9bc7d5..f21458ca40 100644 --- a/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/routes/StorageDirectivesSpec.scala +++ b/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/routes/StorageDirectivesSpec.scala @@ -1,7 +1,5 @@ package ch.epfl.bluebrain.nexus.storage.routes -import java.util.regex.Pattern.quote - import akka.http.scaladsl.model.{StatusCodes, Uri} import akka.http.scaladsl.server.Directives._ import akka.http.scaladsl.testkit.ScalatestRouteTest @@ -9,17 +7,12 @@ import ch.epfl.bluebrain.nexus.storage.JsonLdCirceSupport._ import ch.epfl.bluebrain.nexus.storage.routes.Routes.exceptionHandler import ch.epfl.bluebrain.nexus.storage.routes.StorageDirectives._ import ch.epfl.bluebrain.nexus.storage.utils.Resources +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec import io.circe.Json -import org.scalatest.Inspectors -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike -class StorageDirectivesSpec - extends AnyWordSpecLike - with Matchers - with ScalatestRouteTest - with Inspectors - with Resources { +import java.util.regex.Pattern.quote + +class StorageDirectivesSpec extends BaseSpec with ScalatestRouteTest with Resources { "the storage directives" when { diff --git a/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/routes/StorageRoutesSpec.scala b/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/routes/StorageRoutesSpec.scala index e7615bd4dd..7d36bf200d 100644 --- a/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/routes/StorageRoutesSpec.scala +++ b/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/routes/StorageRoutesSpec.scala @@ -24,26 +24,22 @@ import ch.epfl.bluebrain.nexus.storage.jsonld.JsonLdContext.addContext import ch.epfl.bluebrain.nexus.storage.routes.instances._ import ch.epfl.bluebrain.nexus.storage.utils.{Randomness, Resources} import ch.epfl.bluebrain.nexus.storage.{AkkaSource, Storages} +import ch.epfl.bluebrain.nexus.testkit.scalatest.BaseSpec import io.circe.Json import org.mockito.{ArgumentMatchersSugar, IdiomaticMockito} -import org.scalatest.OptionValues import org.scalatest.concurrent.ScalaFutures -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike import java.nio.file.Paths import java.util.regex.Pattern.quote import scala.concurrent.duration._ class StorageRoutesSpec - extends AnyWordSpecLike - with Matchers + extends BaseSpec with ScalatestRouteTest with IdiomaticMockito with Randomness with Resources with ArgumentMatchersSugar - with OptionValues with ScalaFutures { implicit override def patienceConfig: PatienceConfig = PatienceConfig(3.second, 15.milliseconds) @@ -54,13 +50,13 @@ class StorageRoutesSpec val route: Route = Routes(storages) trait Ctx { - val name = genString() + val name = randomString() val resourceCtx = "https://bluebrain.github.io/nexus/contexts/resource.json" } trait RandomFile extends Ctx { - val filename = s"${genString()}.json" - val content = Json.obj("key" -> Json.fromString(genString())).noSpaces + val filename = s"${randomString()}.json" + val content = Json.obj("key" -> Json.fromString(randomString())).noSpaces val source: AkkaSource = Source.single(ByteString(content)) implicit val bucketExists: BucketExists = BucketExists implicit val pathExists: PathExists = PathExists @@ -169,7 +165,7 @@ class StorageRoutesSpec "pass" in new RandomFileCreate { val absoluteFilePath = appConfig.storage.rootVolume.resolve(filePath) - val digest = Digest("SHA-256", genString()) + val digest = Digest("SHA-256", randomString()) val attributes = FileAttributes(s"file://$absoluteFilePath", 12L, digest, `application/octet-stream`) storages.exists(name) shouldReturn BucketExists storages.pathExists(name, filePathUri) shouldReturn PathDoesNotExist @@ -389,7 +385,7 @@ class StorageRoutesSpec val filePathUri = Uri.Path(s"$filename") storages.exists(name) shouldReturn BucketExists val attributes = - FileAttributes(s"file://$filePathUri", genInt().toLong, Digest("SHA-256", genString()), `image/jpeg`) + FileAttributes(s"file://$filePathUri", genInt().toLong, Digest("SHA-256", randomString()), `image/jpeg`) storages.getAttributes(name, filePathUri) shouldReturn IO(attributes) storages.pathExists(name, filePathUri) shouldReturn PathExists diff --git a/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/utils/Randomness.scala b/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/utils/Randomness.scala index a7b2fec7a2..b3310d2283 100644 --- a/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/utils/Randomness.scala +++ b/storage/src/test/scala/ch/epfl/bluebrain/nexus/storage/utils/Randomness.scala @@ -4,7 +4,7 @@ import scala.util.Random trait Randomness { - def genString(size: Int = 10): String = Random.alphanumeric.take(size).mkString + def randomString(size: Int = 10): String = Random.alphanumeric.take(size).mkString final def genInt(max: Int = 100): Int = Random.nextInt(max) diff --git a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/BaseIntegrationSpec.scala b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/BaseIntegrationSpec.scala index f9aaaf1f41..ce537a94d1 100644 --- a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/BaseIntegrationSpec.scala +++ b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/BaseIntegrationSpec.scala @@ -11,7 +11,8 @@ import cats.effect.concurrent.Ref import cats.syntax.all._ import ch.epfl.bluebrain.nexus.delta.kernel.Logger import ch.epfl.bluebrain.nexus.testkit._ -import ch.epfl.bluebrain.nexus.testkit.ce.{CatsRunContext, IOFixedClock} +import ch.epfl.bluebrain.nexus.testkit.bio.IOFixedClock +import ch.epfl.bluebrain.nexus.testkit.ce.CatsRunContext import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues import ch.epfl.bluebrain.nexus.testkit.scalatest.ce.{CatsEffectAsyncScalaTestAdapter, CatsIOValues} import ch.epfl.bluebrain.nexus.tests.BaseIntegrationSpec._ @@ -27,10 +28,10 @@ import ch.epfl.bluebrain.nexus.tests.kg.{ElasticSearchViewsDsl, KgDsl} import com.typesafe.config.ConfigFactory import io.circe.Json import org.scalactic.source.Position +import org.scalatest._ import org.scalatest.concurrent.{Eventually, ScalaFutures} import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AsyncWordSpecLike -import org.scalatest.{Assertion, BeforeAndAfterAll, Inspectors, OptionValues} import scala.concurrent.duration._ @@ -53,6 +54,7 @@ trait BaseIntegrationSpec with TestHelpers with ScalatestRouteTest with Eventually + with AppendedClues with ScalaFutures { private val logger = Logger.cats[this.type] diff --git a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/admin/OrgsSpec.scala b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/admin/OrgsSpec.scala index 76440af3f8..997bdcafb8 100644 --- a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/admin/OrgsSpec.scala +++ b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/admin/OrgsSpec.scala @@ -1,13 +1,12 @@ package ch.epfl.bluebrain.nexus.tests.admin import akka.http.scaladsl.model.StatusCodes -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues import ch.epfl.bluebrain.nexus.tests.Identity.orgs.{Fry, Leela} import ch.epfl.bluebrain.nexus.tests.Optics._ import ch.epfl.bluebrain.nexus.tests.{BaseIntegrationSpec, ExpectedResponse} import io.circe.Json -class OrgsSpec extends BaseIntegrationSpec with EitherValues { +class OrgsSpec extends BaseIntegrationSpec { import ch.epfl.bluebrain.nexus.tests.iam.types.Permission._ diff --git a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/AggregationsSpec.scala b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/AggregationsSpec.scala index acccccb7b1..764d9642bb 100644 --- a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/AggregationsSpec.scala +++ b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/AggregationsSpec.scala @@ -2,17 +2,14 @@ package ch.epfl.bluebrain.nexus.tests.kg import akka.http.scaladsl.model.StatusCodes import cats.syntax.all._ -import ch.epfl.bluebrain.nexus.testkit.CirceEq -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues -import ch.epfl.bluebrain.nexus.tests.{BaseIntegrationSpec, SchemaPayload} import ch.epfl.bluebrain.nexus.tests.Identity.Anonymous import ch.epfl.bluebrain.nexus.tests.Identity.aggregations.{Charlie, Rose} import ch.epfl.bluebrain.nexus.tests.iam.types.Permission.{Organizations, Resources, Views} import ch.epfl.bluebrain.nexus.tests.resources.SimpleResource +import ch.epfl.bluebrain.nexus.tests.{BaseIntegrationSpec, SchemaPayload} import io.circe.Json -import org.scalatest.Inspectors -final class AggregationsSpec extends BaseIntegrationSpec with Inspectors with EitherValues with CirceEq { +final class AggregationsSpec extends BaseIntegrationSpec { private val org1 = genId() private val proj11 = genId() diff --git a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/ArchiveSpec.scala b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/ArchiveSpec.scala index 7fa3d4b0b3..763d62b5a7 100644 --- a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/ArchiveSpec.scala +++ b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/ArchiveSpec.scala @@ -5,7 +5,6 @@ import akka.http.scaladsl.model.{MediaRanges, MediaTypes, StatusCodes, Uri} import akka.http.scaladsl.unmarshalling.PredefinedFromEntityUnmarshallers import akka.util.ByteString import ch.epfl.bluebrain.nexus.delta.kernel.utils.UrlUtils -import ch.epfl.bluebrain.nexus.testkit.CirceEq import ch.epfl.bluebrain.nexus.testkit.archive.ArchiveHelpers import ch.epfl.bluebrain.nexus.tests.HttpClient._ import ch.epfl.bluebrain.nexus.tests.Identity.archives.Tweety @@ -17,7 +16,7 @@ import io.circe.Json import java.nio.file.Paths -class ArchiveSpec extends BaseIntegrationSpec with ArchiveHelpers with CirceEq { +class ArchiveSpec extends BaseIntegrationSpec with ArchiveHelpers { private val orgId = genId() private val projId = genId() diff --git a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/ElasticSearchViewsSpec.scala b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/ElasticSearchViewsSpec.scala index 6245ca6196..adf8b6d81e 100644 --- a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/ElasticSearchViewsSpec.scala +++ b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/ElasticSearchViewsSpec.scala @@ -2,8 +2,6 @@ package ch.epfl.bluebrain.nexus.tests.kg import akka.http.scaladsl.model.StatusCodes import cats.implicits._ -import ch.epfl.bluebrain.nexus.testkit.CirceEq -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues import ch.epfl.bluebrain.nexus.tests.BaseIntegrationSpec import ch.epfl.bluebrain.nexus.tests.Identity.Anonymous import ch.epfl.bluebrain.nexus.tests.Identity.views.ScoobyDoo @@ -11,7 +9,7 @@ import ch.epfl.bluebrain.nexus.tests.Optics._ import ch.epfl.bluebrain.nexus.tests.iam.types.Permission.{Organizations, Views} import io.circe.{ACursor, Json} -class ElasticSearchViewsSpec extends BaseIntegrationSpec with EitherValues with CirceEq { +class ElasticSearchViewsSpec extends BaseIntegrationSpec { private val orgId = genId() private val projId = genId() diff --git a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/ErrorsSpec.scala b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/ErrorsSpec.scala index 472a8b3e94..d86c253422 100644 --- a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/ErrorsSpec.scala +++ b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/ErrorsSpec.scala @@ -1,11 +1,10 @@ package ch.epfl.bluebrain.nexus.tests.kg import akka.http.scaladsl.model.StatusCodes -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues import ch.epfl.bluebrain.nexus.tests.{BaseIntegrationSpec, Identity} import io.circe.Json -class ErrorsSpec extends BaseIntegrationSpec with EitherValues { +class ErrorsSpec extends BaseIntegrationSpec { "The /errors/invalid endpoint" should { s"return the proper error code" in { diff --git a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/EventsSpec.scala b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/EventsSpec.scala index 8532db1565..fbfd134b15 100644 --- a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/EventsSpec.scala +++ b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/EventsSpec.scala @@ -8,9 +8,8 @@ import ch.epfl.bluebrain.nexus.tests.Optics._ import ch.epfl.bluebrain.nexus.tests.iam.types.Permission.{Events, Organizations, Resources} import ch.epfl.bluebrain.nexus.tests.resources.SimpleResource import io.circe.Json -import org.scalatest.Inspectors -class EventsSpec extends BaseIntegrationSpec with Inspectors { +class EventsSpec extends BaseIntegrationSpec { private val orgId = genId() private val orgId2 = genId() diff --git a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/GraphAnalyticsSpec.scala b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/GraphAnalyticsSpec.scala index 72fa7077d8..e9b9d300c5 100644 --- a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/GraphAnalyticsSpec.scala +++ b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/GraphAnalyticsSpec.scala @@ -2,8 +2,6 @@ package ch.epfl.bluebrain.nexus.tests.kg import akka.http.scaladsl.model.StatusCodes import cats.implicits._ -import ch.epfl.bluebrain.nexus.testkit.CirceEq -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues import ch.epfl.bluebrain.nexus.tests.BaseIntegrationSpec import ch.epfl.bluebrain.nexus.tests.Identity.Anonymous import ch.epfl.bluebrain.nexus.tests.Identity.projects.Bojack @@ -11,7 +9,7 @@ import ch.epfl.bluebrain.nexus.tests.Optics._ import ch.epfl.bluebrain.nexus.tests.iam.types.Permission.{Events, Organizations, Projects, Resources} import io.circe.Json -final class GraphAnalyticsSpec extends BaseIntegrationSpec with CirceEq with EitherValues { +final class GraphAnalyticsSpec extends BaseIntegrationSpec { private val org = genId() private val proj = genId() private val ref = s"$org/$proj" diff --git a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/ListingsSpec.scala b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/ListingsSpec.scala index d5fbd7f4bb..a4d1a44a3b 100644 --- a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/ListingsSpec.scala +++ b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/ListingsSpec.scala @@ -2,21 +2,18 @@ package ch.epfl.bluebrain.nexus.tests.kg import akka.http.scaladsl.model.StatusCodes import ch.epfl.bluebrain.nexus.delta.kernel.utils.UrlUtils -import ch.epfl.bluebrain.nexus.testkit.CirceEq -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues -import ch.epfl.bluebrain.nexus.tests.{BaseIntegrationSpec, SchemaPayload} import ch.epfl.bluebrain.nexus.tests.Identity.listings.{Alice, Bob} import ch.epfl.bluebrain.nexus.tests.Identity.{Anonymous, Delta} import ch.epfl.bluebrain.nexus.tests.Optics._ import ch.epfl.bluebrain.nexus.tests.iam.types.Permission.{Organizations, Resources, Views} import ch.epfl.bluebrain.nexus.tests.resources.SimpleResource +import ch.epfl.bluebrain.nexus.tests.{BaseIntegrationSpec, SchemaPayload} import io.circe.Json -import org.scalatest.Inspectors import java.net.URLEncoder import java.util.UUID -final class ListingsSpec extends BaseIntegrationSpec with Inspectors with EitherValues with CirceEq { +final class ListingsSpec extends BaseIntegrationSpec { private val org1 = genId() private val proj11 = genId() diff --git a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/ProjectsDeletionSpec.scala b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/ProjectsDeletionSpec.scala index 4fe0fc2f00..0c04c26611 100644 --- a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/ProjectsDeletionSpec.scala +++ b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/ProjectsDeletionSpec.scala @@ -1,8 +1,6 @@ package ch.epfl.bluebrain.nexus.tests.kg import akka.http.scaladsl.model.{ContentTypes, StatusCodes} -import ch.epfl.bluebrain.nexus.testkit.CirceEq -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues import ch.epfl.bluebrain.nexus.tests.Identity.projects.{Bojack, PrincessCarolyn} import ch.epfl.bluebrain.nexus.tests.Identity.{Anonymous, ServiceAccount} import ch.epfl.bluebrain.nexus.tests.Optics.{admin, listing, supervision} @@ -11,12 +9,11 @@ import ch.epfl.bluebrain.nexus.tests.resources.SimpleResource import ch.epfl.bluebrain.nexus.tests.{BaseIntegrationSpec, Identity, SchemaPayload} import io.circe.Json import io.circe.optics.JsonPath.root -import org.scalatest.AppendedClues import java.io.File import scala.reflect.io.Directory -final class ProjectsDeletionSpec extends BaseIntegrationSpec with CirceEq with EitherValues with AppendedClues { +final class ProjectsDeletionSpec extends BaseIntegrationSpec { private val org = genId() private val proj1 = genId() diff --git a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/ResourcesSpec.scala b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/ResourcesSpec.scala index 849199c293..c5266ed735 100644 --- a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/ResourcesSpec.scala +++ b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/ResourcesSpec.scala @@ -7,7 +7,6 @@ import akka.http.scaladsl.unmarshalling.PredefinedFromEntityUnmarshallers import cats.effect.IO import cats.implicits._ import ch.epfl.bluebrain.nexus.delta.kernel.utils.UrlUtils -import ch.epfl.bluebrain.nexus.testkit.CirceEq import ch.epfl.bluebrain.nexus.tests.Identity.Anonymous import ch.epfl.bluebrain.nexus.tests.Identity.resources.{Morty, Rick} import ch.epfl.bluebrain.nexus.tests.Optics.admin._constrainedBy @@ -24,7 +23,7 @@ import org.scalatest.matchers.{HavePropertyMatchResult, HavePropertyMatcher} import java.net.URLEncoder -class ResourcesSpec extends BaseIntegrationSpec with CirceEq { +class ResourcesSpec extends BaseIntegrationSpec { private val orgId = genId() private val projId1 = genId() diff --git a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/SchemasSpec.scala b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/SchemasSpec.scala index 805912cb4b..3926057a21 100644 --- a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/SchemasSpec.scala +++ b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/SchemasSpec.scala @@ -2,17 +2,14 @@ package ch.epfl.bluebrain.nexus.tests.kg import akka.http.scaladsl.model.StatusCodes import ch.epfl.bluebrain.nexus.delta.kernel.utils.UrlUtils -import ch.epfl.bluebrain.nexus.testkit.CirceEq -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues import ch.epfl.bluebrain.nexus.tests.BaseIntegrationSpec import ch.epfl.bluebrain.nexus.tests.Identity.resources.Rick import ch.epfl.bluebrain.nexus.tests.builders.SchemaPayloads._ import ch.epfl.bluebrain.nexus.tests.iam.types.Permission.Organizations import io.circe.Json -import org.scalatest.BeforeAndAfterAll import org.scalatest.LoneElement._ -class SchemasSpec extends BaseIntegrationSpec with EitherValues with CirceEq with BeforeAndAfterAll { +class SchemasSpec extends BaseIntegrationSpec { private val orgId = genId() private val projId = genId() diff --git a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/SparqlViewsSpec.scala b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/SparqlViewsSpec.scala index a317a45f6a..b38d07a1cb 100644 --- a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/SparqlViewsSpec.scala +++ b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/SparqlViewsSpec.scala @@ -2,8 +2,6 @@ package ch.epfl.bluebrain.nexus.tests.kg import akka.http.scaladsl.model.StatusCodes import cats.implicits._ -import ch.epfl.bluebrain.nexus.testkit.CirceEq -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues import ch.epfl.bluebrain.nexus.tests.BaseIntegrationSpec import ch.epfl.bluebrain.nexus.tests.Identity.Anonymous import ch.epfl.bluebrain.nexus.tests.Identity.views.ScoobyDoo @@ -11,7 +9,7 @@ import ch.epfl.bluebrain.nexus.tests.Optics._ import ch.epfl.bluebrain.nexus.tests.iam.types.Permission.{Organizations, Views} import io.circe.Json -class SparqlViewsSpec extends BaseIntegrationSpec with EitherValues with CirceEq { +class SparqlViewsSpec extends BaseIntegrationSpec { private val orgId = genId() private val projId = genId() diff --git a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/StorageSpec.scala b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/StorageSpec.scala index c00fa4d92d..023a1e1fa3 100644 --- a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/StorageSpec.scala +++ b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/StorageSpec.scala @@ -1,10 +1,9 @@ package ch.epfl.bluebrain.nexus.tests.kg -import akka.http.scaladsl.model.headers.{ContentDispositionTypes, HttpEncodings} import akka.http.scaladsl.model._ +import akka.http.scaladsl.model.headers.{ContentDispositionTypes, HttpEncodings} import akka.util.ByteString import cats.effect.IO -import ch.epfl.bluebrain.nexus.testkit.CirceEq import ch.epfl.bluebrain.nexus.tests.BaseIntegrationSpec import ch.epfl.bluebrain.nexus.tests.HttpClient._ import ch.epfl.bluebrain.nexus.tests.Identity.storages.Coyote @@ -20,7 +19,7 @@ import org.scalatest.Assertion import java.util.Base64 -abstract class StorageSpec extends BaseIntegrationSpec with CirceEq { +abstract class StorageSpec extends BaseIntegrationSpec { val storageConfig: StorageConfig = load[StorageConfig](ConfigFactory.load(), "storage") diff --git a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/SupervisionSpec.scala b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/SupervisionSpec.scala index 1316cce077..5131c38603 100644 --- a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/SupervisionSpec.scala +++ b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/SupervisionSpec.scala @@ -1,15 +1,13 @@ package ch.epfl.bluebrain.nexus.tests.kg import akka.http.scaladsl.model.StatusCodes -import ch.epfl.bluebrain.nexus.testkit.CirceLiteral -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues import ch.epfl.bluebrain.nexus.tests.BaseIntegrationSpec import ch.epfl.bluebrain.nexus.tests.Identity.supervision.Mickey import ch.epfl.bluebrain.nexus.tests.Optics.{filterKeys, projections} import ch.epfl.bluebrain.nexus.tests.iam.types.Permission.{Events, Organizations, Supervision} import io.circe._ -class SupervisionSpec extends BaseIntegrationSpec with EitherValues with CirceLiteral { +class SupervisionSpec extends BaseIntegrationSpec { "The supervision endpoint" should { s"reject calls without ${Supervision.Read.value} permission" in { diff --git a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/VersionSpec.scala b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/VersionSpec.scala index 8f1738c6b1..4ef005822d 100644 --- a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/VersionSpec.scala +++ b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/kg/VersionSpec.scala @@ -1,14 +1,13 @@ package ch.epfl.bluebrain.nexus.tests.kg import akka.http.scaladsl.model.StatusCodes -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues import ch.epfl.bluebrain.nexus.tests.iam.types.Permission import ch.epfl.bluebrain.nexus.tests.kg.VersionSpec.VersionBundle import ch.epfl.bluebrain.nexus.tests.{BaseIntegrationSpec, Identity} import io.circe.generic.semiauto.deriveDecoder import io.circe.{Decoder, Json} -class VersionSpec extends BaseIntegrationSpec with EitherValues { +class VersionSpec extends BaseIntegrationSpec { "The /version endpoint" should { s"be protected by ${Permission.Version.Read.value}" in { diff --git a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/plugins/blazegraph/IncomingOutgoingBlazegraphSpec.scala b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/plugins/blazegraph/IncomingOutgoingBlazegraphSpec.scala index 932b9ad3c3..0fd3a3fe94 100644 --- a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/plugins/blazegraph/IncomingOutgoingBlazegraphSpec.scala +++ b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/plugins/blazegraph/IncomingOutgoingBlazegraphSpec.scala @@ -1,7 +1,6 @@ package ch.epfl.bluebrain.nexus.tests.plugins.blazegraph import akka.http.scaladsl.model.StatusCodes -import ch.epfl.bluebrain.nexus.testkit.scalatest.EitherValues import ch.epfl.bluebrain.nexus.tests.BaseIntegrationSpec import ch.epfl.bluebrain.nexus.tests.Identity.mash.Radar import ch.epfl.bluebrain.nexus.tests.iam.types.Permission.Organizations @@ -21,7 +20,7 @@ import java.time.Instant * 4. test the incoming references * 5. test the outgoing references */ -class IncomingOutgoingBlazegraphSpec extends BaseIntegrationSpec with EitherValues { +class IncomingOutgoingBlazegraphSpec extends BaseIntegrationSpec { private val orgLabel = genId() private val projLabel = genId() diff --git a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/resources/ResourcesTrialSpec.scala b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/resources/ResourcesTrialSpec.scala index a84abcd73b..80e4be1d64 100644 --- a/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/resources/ResourcesTrialSpec.scala +++ b/tests/src/test/scala/ch/epfl/bluebrain/nexus/tests/resources/ResourcesTrialSpec.scala @@ -1,13 +1,12 @@ package ch.epfl.bluebrain.nexus.tests.resources import akka.http.scaladsl.model.StatusCodes -import ch.epfl.bluebrain.nexus.testkit.CirceEq import ch.epfl.bluebrain.nexus.tests.Identity.listings.{Alice, Bob} import ch.epfl.bluebrain.nexus.tests.{BaseIntegrationSpec, SchemaPayload} import io.circe.Json import io.circe.optics.JsonPath.root -class ResourcesTrialSpec extends BaseIntegrationSpec with CirceEq { +class ResourcesTrialSpec extends BaseIntegrationSpec { private val org = genId() private val proj = genId()