Skip to content

Commit

Permalink
simplify TDB setting
Browse files Browse the repository at this point in the history
  • Loading branch information
BalduinLandolt committed Feb 15, 2024
1 parent 293f194 commit b321783
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import org.knora.webapi.store.triplestore.api.TriplestoreServiceInMemory

object KnoraProjectRepoLiveSpec extends ZIOSpecDefault {

TDB.getContext.set(TDB.symUnionDefaultGraph, true)

private val someProject = KnoraProject(
ProjectIri.unsafeFrom("http://rdfh.ch/projects/1234"),
Shortname.unsafeFrom("project1"),
Expand Down Expand Up @@ -74,7 +76,6 @@ object KnoraProjectRepoLiveSpec extends ZIOSpecDefault {
test("return all projects if some exist") {
for {
_ <- TriplestoreServiceInMemory.setDataSetFromTriG(someProjectTrig)
_ = TDB.getContext.set(TDB.symUnionDefaultGraph, true)
projects <- findAll
} yield assertTrue(projects == List(someProject))
},
Expand All @@ -89,7 +90,6 @@ object KnoraProjectRepoLiveSpec extends ZIOSpecDefault {
test("return project if it exists") {
for {
_ <- TriplestoreServiceInMemory.setDataSetFromTriG(someProjectTrig)
_ = TDB.getContext.set(TDB.symUnionDefaultGraph, true)
project <- findById(ProjectIdentifierADM.IriIdentifier.unsafeFrom("http://rdfh.ch/projects/1234"))
} yield assertTrue(project.contains(someProject))
},
Expand All @@ -103,7 +103,6 @@ object KnoraProjectRepoLiveSpec extends ZIOSpecDefault {
test("return project if it exists") {
for {
_ <- TriplestoreServiceInMemory.setDataSetFromTriG(someProjectTrig)
_ = TDB.getContext.set(TDB.symUnionDefaultGraph, true)
project <- findById(ProjectIdentifierADM.ShortcodeIdentifier.unsafeFrom("1234"))
} yield assertTrue(project.contains(someProject))
},
Expand All @@ -117,7 +116,6 @@ object KnoraProjectRepoLiveSpec extends ZIOSpecDefault {
test("return project if it exists") {
for {
_ <- TriplestoreServiceInMemory.setDataSetFromTriG(someProjectTrig)
_ = TDB.getContext.set(TDB.symUnionDefaultGraph, true)
project <- findById(ProjectIdentifierADM.ShortnameIdentifier.unsafeFrom("project1"))
} yield assertTrue(project.contains(someProject))
},
Expand Down

0 comments on commit b321783

Please sign in to comment.