Closed domdorn closed 2 years ago
@domdorn this is consistent with akka-http-testkit
:
Get() ~> smallRoute ~> check {
contentType shouldEqual ContentTypes.`text/plain(UTF-8)`
headers shouldEqual Seq()
}
With this behaviour you can check that content type is not specified manually by directives, but instead inferred from entity.
headers
is only for headers provided by directives.
I'd prefer to keep behaviour aligned to akka-http-testkit
.
thanks for clarifying. will update my tests accordingly (we've used the contentType matcher before)
When migrating my tests from version
1.0.3
to1.0.15
I've experienced the following behavior: The following code fails cause no headers or at least not theContent-Type
header get populated in theCompleted
/EagerCompleted
:I haven't tested if other headers are also missing, but at least the
Content-Type
header is missing.I found a workaround: directly use the
contentType
property onEagerCompleted
. However, this breaks some existing user tests (at least in my codebase) and is unexpected behavior.