Skip to content

Commit

Permalink
Add headers to faked response in client tests
Browse files Browse the repository at this point in the history
  • Loading branch information
daddykotex committed Oct 25, 2022
1 parent dd74c0c commit e86371c
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import smithy4s.tests.DefaultSchemaVisitor
import scala.concurrent.duration._
import smithy4s.http.HttpMediaType
import org.http4s.MediaType
import org.http4s.Header

abstract class ClientHttpComplianceTestCase[
P,
Expand Down Expand Up @@ -207,9 +208,15 @@ abstract class ClientHttpComplianceTestCase[
.through(utf8Encode)
}
.getOrElse(fs2.Stream.empty)
val headers: Seq[Header.ToRaw] =
testCase.headers.toList.flatMap(_.toList).map {
case (key, value) =>
Header.Raw(CIString(key), value)
}
req.body.compile.drain.as(
Response[IO](status)
.withBodyStream(body)
.putHeaders(headers: _*)
.putHeaders(
`Content-Type`(MediaType.unsafeParse(mediaType.value))
)
Expand Down

0 comments on commit e86371c

Please sign in to comment.