böyle json unmarshalls bir bitiş noktası varsa:SprayTest'te bir POST istemiyle bir POST isteğini nasıl taklit edebilirim?
(path("signup")& post) {
entity(as[Credentials]) { credentials =>
…
nasıl test edebileceği bir Sprey testi spec ile:
"The Authentication service" should {
"create a new account if none exists" in {
Post("/api/authentication/signup", """{"email":"foo", "password":"foo:" }""") ~> authenticationRoute ~> check {
handled === true
}
}
}
besbelli çeşitli nedenlerle çalışmıyor. Doğru yol ne olurdu?
inanıyorum olarak Json istek içine
sprey otomatik Marshall onu Bu artık en son sürümle çalışmıyor. Bunun yerine, şunu yapın: '' Post ("/ api/kimlik doğrulama/kayıt", HttpEntity (MediaTypes.'application/json', "" "{" email ":" foo "," password ":" foo "}" ""))) '' –
@ GregaBasım herhangi bir sürümle mükemmel çalışır. Halihazırda sprey 1.3.1 ile akka 2.3.3 – 4lex1v
@AlexIv HttpBody nesnesi nerededir? –