Skip to content

Commit

Permalink
fix compile
Browse files Browse the repository at this point in the history
  • Loading branch information
seakayone committed Jun 3, 2024
1 parent 2f41e00 commit 011c6fd
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions integration/src/test/scala/org/knora/sipi/SipiIT.scala
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ object SipiIT extends ZIOSpecDefault {
_ <- MockDspApiServer.resetAndAllowWithPermissionCode(prefix, imageTestfile, 2)
jwt <- createJwt(AuthScope.admin)
response <- requestGet(
Root / prefix / imageTestfile / "file",
Path.roott / prefix / imageTestfile / "file",
Header.Cookie(
NonEmptyChunk(
Cookie.Request(
Expand All @@ -98,7 +98,7 @@ object SipiIT extends ZIOSpecDefault {
_ <- MockDspApiServer.resetAndAllowWithPermissionCode(prefix, imageTestfile, 2)
jwt <- createJwt(AuthScope.admin)
response <- requestGet(
Root / prefix / imageTestfile / "file",
Path.Path.root / prefix / imageTestfile / "file",
Header.Cookie(NonEmptyChunk(Cookie.Request("KnoraAuthenticationGAXDALRQFYYDUMZTGMZQ9999", jwt))),
)
requestToDspApiContainsJwt <- MockDspApiServer.verifyAuthBearerTokenReceived(jwt)
Expand All @@ -113,7 +113,7 @@ object SipiIT extends ZIOSpecDefault {
_ <- MockDspApiServer.resetAndAllowWithPermissionCode(prefix, imageTestfile, 2)
jwt <- createJwt(AuthScope.write(Shortcode.unsafeFrom(prefix)))
response <- requestGet(
Root / prefix / imageTestfile / "full" / "max" / "0" / "default.jpg",
Path.root / prefix / imageTestfile / "full" / "max" / "0" / "default.jpg",
Header.Cookie(NonEmptyChunk(Cookie.Request("KnoraAuthenticationGAXDALRQFYYDUMZTGMZQ9999", jwt))),
)
noInteraction <- MockDspApiServer.verifyNoInteraction
Expand Down Expand Up @@ -144,7 +144,7 @@ object SipiIT extends ZIOSpecDefault {
|}""".stripMargin.fromJson[Json]
for {
_ <- MockDspApiServer.resetAndAllowWithPermissionCode(prefix, imageTestfile, permissionCode = 2)
response <- requestGet(Root / prefix / imageTestfile / "knora.json")
response <- requestGet(Path.root / prefix / imageTestfile / "knora.json")
json <- response.body.asString.map(_.fromJson[Json])
expected <- SipiTestContainer.portAndHost.map { case (port, host) => expectedJson(port, host) }
} yield assertTrue(
Expand All @@ -163,7 +163,7 @@ object SipiIT extends ZIOSpecDefault {
test("When getting the file, then Sipi responds with Not Found") {
for {
server <- MockDspApiServer.resetAndGetWireMockServer
response <- requestGet(Root / prefix / "doesnotexist.jp2" / "file")
response <- requestGet(Path.root / prefix / "doesnotexist.jp2" / "file")
} yield assertTrue(response.status == Status.NotFound, verifyNoInteractionWith(server))
},
),
Expand All @@ -178,7 +178,7 @@ object SipiIT extends ZIOSpecDefault {
val dspApiPermissionPath = s"/admin/files/$prefix/$imageTestfile"
for {
server <- MockDspApiServer.resetAndStubGetResponse(dspApiPermissionPath, 200, dspApiResponse)
response <- requestGet(Root / prefix / imageTestfile / "file")
response <- requestGet(Path.root / prefix / imageTestfile / "file")
} yield assertTrue(
response.status == Status.Ok,
verifySingleGetRequest(server, dspApiPermissionPath),
Expand All @@ -194,7 +194,7 @@ object SipiIT extends ZIOSpecDefault {
val dspApiPermissionPath = s"/admin/files/$prefix/$imageTestfile"
for {
server <- MockDspApiServer.resetAndStubGetResponse(dspApiPermissionPath, 200, dspApiResponse)
response <- requestGet(Root / prefix / imageTestfile / "file")
response <- requestGet(Path.root / prefix / imageTestfile / "file")
} yield assertTrue(
response.status == Status.Unauthorized,
verifySingleGetRequest(server, dspApiPermissionPath),
Expand All @@ -208,7 +208,7 @@ object SipiIT extends ZIOSpecDefault {
val dspApiPermissionPath = s"/admin/files/$prefix/$imageTestfile"
for {
server <- MockDspApiServer.resetAndStubGetResponse(dspApiPermissionPath, 404)
response <- requestGet(Root / prefix / imageTestfile / "file")
response <- requestGet(Path.root / prefix / imageTestfile / "file")
} yield assertTrue(
response.status == Status.NotFound,
verifySingleGetRequest(server, dspApiPermissionPath),
Expand All @@ -228,7 +228,7 @@ object SipiIT extends ZIOSpecDefault {
for {
server <- MockDspApiServer.resetAndGetWireMockServer
response <-
requestGet(Root / prefix / "doesnotexist.jp2" / "full" / "max" / "0" / "default.jp2")
requestGet(Path.root / prefix / "doesnotexist.jp2" / "full" / "max" / "0" / "default.jp2")
} yield assertTrue(response.status == Status.NotFound, verifyNoInteractionWith(server))
},
),
Expand All @@ -243,7 +243,7 @@ object SipiIT extends ZIOSpecDefault {
val dspApiPermissionPath = s"/admin/files/$prefix/$imageTestfile"
for {
server <- MockDspApiServer.resetAndStubGetResponse(dspApiPermissionPath, 200, dspApiResponse)
response <- requestGet(Root / prefix / imageTestfile / "full/max/0/default.jp2")
response <- requestGet(Path.root / prefix / imageTestfile / "full/max/0/default.jp2")
} yield assertTrue(
response.status == Status.Ok,
verifySingleGetRequest(server, dspApiPermissionPath),
Expand All @@ -259,7 +259,7 @@ object SipiIT extends ZIOSpecDefault {
val dspApiPermissionPath = s"/admin/files/$prefix/$imageTestfile"
for {
server <- MockDspApiServer.resetAndStubGetResponse(dspApiPermissionPath, 200, dspApiResponse)
response <- requestGet(Root / prefix / imageTestfile / "full/max/0/default.jp2")
response <- requestGet(Path.root / prefix / imageTestfile / "full/max/0/default.jp2")
} yield assertTrue(
response.status == Status.Unauthorized,
verifySingleGetRequest(server, dspApiPermissionPath),
Expand All @@ -273,7 +273,7 @@ object SipiIT extends ZIOSpecDefault {
val dspApiPermissionPath = s"/admin/files/$prefix/$imageTestfile"
for {
server <- MockDspApiServer.resetAndStubGetResponse(dspApiPermissionPath, 404)
response <- requestGet(Root / prefix / imageTestfile / "full/max/0/default.jp2")
response <- requestGet(Path.root / prefix / imageTestfile / "full/max/0/default.jp2")
} yield assertTrue(
response.status == Status.NotFound,
verifySingleGetRequest(server, dspApiPermissionPath),
Expand All @@ -291,7 +291,7 @@ object SipiIT extends ZIOSpecDefault {
test("health check works") {
for {
server <- MockDspApiServer.resetAndGetWireMockServer
response <- requestGet(Root / "server" / "test.html")
response <- requestGet(Path.root / "server" / "test.html")
} yield assertTrue(response.status.isSuccess, verifyNoInteractionWith(server))
},
)
Expand Down

0 comments on commit 011c6fd

Please sign in to comment.