Hi,
I am using akka-http and the corresponding testkit version 1.0-RC3. The
following code
Put(s"/authentication/user/oscar", oscarDataNoEmail) ~>
addCredentials(credentials) ~> authRoute ~> check {
responseAs[String] === "Hi"
response.status === StatusCodes.BadRequest
}
results in Could not unmarshal response to type 'java.lang.String' for
`responseAs` assertion: akka.http.scaladsl.un
marshalling.Unmarshaller$UnsupportedContentTypeException: Unsupported
Content-Type, supported: application/json. Then it says
Response was: HttpResponse(400 Bad
Request,List(Access-Control-Allow-Origin: http://localhost, Access-Con
trol-Allow-Credentials: true, Access-Control-Allow-Headers: Authorization,
Content-Type, X-Requested-With),HttpEntit
y.Strict(text/plain; charset=UTF-8,ByteString(84, 104, 101, 32, 114, 101,
113, 117, 101, 115, 116, 32, 99, 111, 110,
116, 97, 105, 110, 115, 32, 98, 97, 100, 32, 115, 121, 110, 116, 97, 120,
32, 111, 114, 32, 99, 97, 110, 110, 111,
116, 32, 98, 101, 32, 102, 117, 108, 102, 105, 108, 108, 101, 100,
46)),HttpProtocol(HTTP/1.1)) (AuthenticationManag
ementSpec.scala:137). So if the response has content type text/plain, why
the heck does the testkit try to unmarshal it with an application/json
unmarshaller and how to point it in the right direction?
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.