Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
kr7ysztof committed Dec 11, 2023
1 parent acecca6 commit b6ff995
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
27 changes: 27 additions & 0 deletions src/main/scala/com/ing/wbaa/rokku/proxy/api/TestService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,33 @@ trait TestService {
complete(StatusCodes.ServiceUnavailable -> "503")
}
}
} ~ path("test200") {
put {
parameters("timeout".as[Long]) { (timeout) =>
logger.debug("start test200")(RequestId("test200"))
Thread.sleep(timeout)
logger.debug("stop test200")(RequestId("test200"))
complete(StatusCodes.OK -> "test")
}
}
} ~ path("test502") {
put {
parameters("timeout".as[Long]) { (timeout) =>
logger.debug("start test502")(RequestId("test200"))
Thread.sleep(timeout)
logger.debug("stop test502")(RequestId("test200"))
complete(StatusCodes.BadGateway -> "502")
}
}
} ~ path("test503") {
put {
parameters("timeout".as[Long]) { (timeout) =>
logger.debug("start test503")(RequestId("test503"))
Thread.sleep(timeout)
logger.debug("stop test503")(RequestId("test503"))
complete(StatusCodes.ServiceUnavailable -> "503")
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import com.ing.wbaa.rokku.proxy.provider.aws.SignatureHelpersCommon.awsVersion
import com.ing.wbaa.rokku.proxy.queue.UserRequestQueue

import scala.concurrent.{ ExecutionContext, Future }
import scala.util.Success
import scala.util.{ Failure, Success }

trait RequestHandlerS3 extends S3Client with UserRequestQueue {

Expand Down Expand Up @@ -81,7 +81,10 @@ trait RequestHandlerS3 extends S3Client with UserRequestQueue {
logger.info(s"Request sent to backend storage: method: {} uri: {}, {}", request.method.value, request.uri.toString(), request)
Http()
.singleRequest(request)
.andThen { case Success(r) => logger.info(s"Received response from backend storage: {}", r.status) }
.andThen {
case Success(r) => logger.info(s"Received response from backend storage: {}", r.status)
case Failure(exception) => logger.error("Backend error e={}", exception)
}
.map(r => r.withEntity(r.entity.withoutSizeLimit()))
}

Expand Down

0 comments on commit b6ff995

Please sign in to comment.