From 22d433ec3cd11ce290a9f1a87648cc9b8cb81250 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Kleinb=C3=B6lting?= Date: Tue, 22 Oct 2024 08:09:16 +0200 Subject: [PATCH] test: Use Authorization header instead of url parms in TestClientService (#3398) --- .../knora/webapi/testservices/TestClientService.scala | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/integration/src/test/scala/org/knora/webapi/testservices/TestClientService.scala b/integration/src/test/scala/org/knora/webapi/testservices/TestClientService.scala index d870cfea20..fe7facf87d 100644 --- a/integration/src/test/scala/org/knora/webapi/testservices/TestClientService.scala +++ b/integration/src/test/scala/org/knora/webapi/testservices/TestClientService.scala @@ -164,14 +164,19 @@ final case class TestClientService( */ def uploadToSipi(loginToken: String, files: Seq[FileToUpload]): Task[SipiUploadResponse] = for { - url <- ZIO.succeed(targetHostUri.addPath("upload").addParam("token", loginToken)) + url <- ZIO.succeed(targetHostUri.addPath("upload")) multiparts = files.map { file => multipartFile("file", file.path.toFile) .fileName(file.path.getFileName.toString) .contentType(file.mimeType.toString) } - response <- doSipiRequest(quickRequest.post(url).multipartBody(multiparts)) - json <- ZIO.fromEither(response.fromJson[SipiUploadResponse]).mapError(Throwable(_)) + response <- doSipiRequest( + quickRequest + .post(url) + .header("Authorization", s"Bearer $loginToken") + .multipartBody(multiparts), + ) + json <- ZIO.fromEither(response.fromJson[SipiUploadResponse]).mapError(Throwable(_)) } yield json /**