scalatest - How to test a JSON array from Spray GET response? -



scalatest - How to test a JSON array from Spray GET response? -

spray says normal info types, including seq (un)marhsalled to/from json, automatically. reason, don't experience this.

import spray.json._ import defaultjsonprotocol._ ... class restapitest extends flatspec matchers scalatestroutetest myroute { ... behavior of "myroute" should "return list json" in { get("/computers") ~> myroute ~> check { status should equal(ok) // 'sbt test' gives: // "could not find implicit value evidence parameter of type spray.httpx.unmarshalling.fromresponseunmarshaller[seq[string]]" // responseas[seq[string]] should contain thesameelementsas( list( "a01", "a02", "a03", "e01", "g04" ) ) } }

what doing wrong?

addendum:

ended mixing in spray.httpx.sprayjsonsupport trait test class, create explicit going on. piece gem - makes testing json rest api's one-liners! happy.

http://spray.io/documentation/1.1-snapshot/spray-httpx/spray-json-support/

thanks @jrudolph :)

json scalatest spray

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -