Skip to content

Commit

Permalink
chore: Rename ITTestDataFactory (#2440)
Browse files Browse the repository at this point in the history
  • Loading branch information
seakayone committed Feb 14, 2023
1 parent 293f6a3 commit dc8b4b5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.knora.webapi.messages.admin.responder.projectsmessages.ProjectIdentif
/**
* Helps in creating value objects for tests.
*/
object TestDataFactory {
object ITTestDataFactory {
def projectShortcodeIdentifier(shortcode: String): ShortcodeIdentifier =
ShortcodeIdentifier
.fromString(shortcode)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ package org.knora.webapi.responders.admin

import akka.actor.Status.Failure
import akka.testkit.ImplicitSender

import java.util.UUID
import scala.concurrent.duration._

import dsp.errors.BadRequestException
import dsp.errors.DuplicateValueException
import dsp.errors.NotFoundException
import dsp.valueobjects.Project._
import dsp.valueobjects.V2

import org.knora.webapi._
import org.knora.webapi.messages.OntologyConstants
import org.knora.webapi.messages.StringFormatter
Expand Down Expand Up @@ -363,15 +362,15 @@ class ProjectsResponderADMSpec extends CoreSpec with ImplicitSender {
}

"UPDATE a project" in {
val iri = TestDataFactory.projectIri(newProjectIri.get)
val updatedLongname = TestDataFactory.projectName("updated project longname")
val updatedDescription = TestDataFactory.projectDescription(
val iri = ITTestDataFactory.projectIri(newProjectIri.get)
val updatedLongname = ITTestDataFactory.projectName("updated project longname")
val updatedDescription = ITTestDataFactory.projectDescription(
Seq(V2.StringLiteralV2("""updated project description with "quotes" and <html tags>""", Some("en")))
)
val updatedKeywords = TestDataFactory.projectKeywords(Seq("updated", "keywords"))
val updatedLogo = TestDataFactory.projectLogo("/fu/bar/baz-updated.jpg")
val projectStatus = TestDataFactory.projectStatus(true)
val selfJoin = TestDataFactory.projectSelfJoin(true)
val updatedKeywords = ITTestDataFactory.projectKeywords(Seq("updated", "keywords"))
val updatedLogo = ITTestDataFactory.projectLogo("/fu/bar/baz-updated.jpg")
val projectStatus = ITTestDataFactory.projectStatus(true)
val selfJoin = ITTestDataFactory.projectSelfJoin(true)

appActor ! ProjectChangeRequestADM(
projectIri = iri,
Expand Down Expand Up @@ -406,8 +405,8 @@ class ProjectsResponderADMSpec extends CoreSpec with ImplicitSender {
}

"return 'NotFound' if a not existing project IRI is submitted during update" in {
val longname = TestDataFactory.projectName("longname")
val iri = TestDataFactory.projectIri(notExistingProjectButValidProjectIri)
val longname = ITTestDataFactory.projectName("longname")
val iri = ITTestDataFactory.projectIri(notExistingProjectButValidProjectIri)
appActor ! ProjectChangeRequestADM(
projectIri = iri,
projectUpdatePayload = ProjectUpdatePayloadADM(longname = Some(longname)),
Expand Down Expand Up @@ -652,7 +651,7 @@ class ProjectsResponderADMSpec extends CoreSpec with ImplicitSender {
}

"return all keywords for a single project" in {
val iri = TestDataFactory.projectIri(SharedTestDataADM.incunabulaProject.id)
val iri = ITTestDataFactory.projectIri(SharedTestDataADM.incunabulaProject.id)
appActor ! ProjectKeywordsGetRequestADM(
projectIri = iri
)
Expand All @@ -661,7 +660,7 @@ class ProjectsResponderADMSpec extends CoreSpec with ImplicitSender {
}

"return empty list for a project without keywords" in {
val iri = TestDataFactory.projectIri(SharedTestDataADM.dokubibProject.id)
val iri = ITTestDataFactory.projectIri(SharedTestDataADM.dokubibProject.id)
appActor ! ProjectKeywordsGetRequestADM(
projectIri = iri
)
Expand All @@ -670,7 +669,7 @@ class ProjectsResponderADMSpec extends CoreSpec with ImplicitSender {
}

"return 'NotFound' when the project IRI is unknown" in {
val iri = TestDataFactory.projectIri(notExistingProjectButValidProjectIri)
val iri = ITTestDataFactory.projectIri(notExistingProjectButValidProjectIri)
appActor ! ProjectKeywordsGetRequestADM(
projectIri = iri
)
Expand Down

0 comments on commit dc8b4b5

Please sign in to comment.