Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Dumas committed Aug 7, 2023
1 parent 42bc8fa commit 8e84341
Showing 1 changed file with 19 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@ import akka.http.scaladsl.model.StatusCodes
import ch.epfl.bluebrain.nexus.tests.BaseSpec
import ch.epfl.bluebrain.nexus.tests.Identity.projects.Bojack
import ch.epfl.bluebrain.nexus.tests.iam.types.Permission.{Events, Organizations, Projects, Resources}
import monix.execution.Scheduler.Implicits.global
import io.circe.Json

import scala.concurrent.duration._

/**
* Test related to automatic project deletion Only checks that the project deletion has been triggered and that the
* project itself has been deleted. All the additional checks on the deletion of resources/views contained in this
* project are done in [[ProjectsDeletionSpec]]
* Tests related to automatic project deletion
*
* Automatic deletion is configured to look up on projects in the `autodeletion` organization and deletes them after 5
* seconds without activity
*
* Only checks that the project deletion has been triggered and that the project itself has been deleted. All the
* additional checks on the deletion of resources/views contained in this project are done in [[ProjectsDeletionSpec]]
*
* @see
* ProjectsDeletionSpec
Expand All @@ -25,16 +30,17 @@ class AutoProjectDeletionSpec extends BaseSpec {
private val proj1 = genId()
private val ref1 = s"$org/$proj1"

"Setting up" should {
"succeed in setting up org and project" in {
for {
_ <- aclDsl.addPermissions("/", Bojack, Set(Organizations.Create, Projects.Delete, Resources.Read, Events.Read))
// First org and projects
_ <- adminDsl.createOrganization(org, org, Bojack, ignoreConflict = true)
_ <- adminDsl.createProject(org, proj1, kgDsl.projectJson(name = proj1), Bojack)
_ <- deltaClient.get[Json](s"/projects/$ref1", Bojack)(expect(StatusCodes.OK))
} yield succeed
}
override def beforeAll(): Unit = {
super.beforeAll()
val setup = for {
_ <- aclDsl.addPermissions("/", Bojack, Set(Organizations.Create, Projects.Delete, Resources.Read, Events.Read))
// First org and projects
_ <- adminDsl.createOrganization(org, org, Bojack, ignoreConflict = true)
_ <- adminDsl.createProject(org, proj1, kgDsl.projectJson(name = proj1), Bojack)
_ <- deltaClient.get[Json](s"/projects/$ref1", Bojack)(expect(StatusCodes.OK))
} yield succeed

setup.void.runSyncUnsafe()
}

"eventually return a not found when attempting to fetch the project" in eventually {
Expand Down

0 comments on commit 8e84341

Please sign in to comment.