Questions tagged [spray-test]

27 questions
1
vote
1 answer

spray-testkit === status passes whatever status is

I have following test in spray-testkit with scalatest and I do not understand why test passes every time despite the actual status. import akka.actor._ import akka.event.LoggingReceive import akka.testkit.TestProbe import…
jaksky
  • 3,305
  • 4
  • 35
  • 68
1
vote
2 answers

Running simple spray route test result: Could not initialize class spray.http.Uri$

I am fairly new to spray . I am trying to get the testing correctly so I used the example shown in spary testkit however I am getting this errors. any assistance will greatly appreciated : The service should Could not initialize class…
igx
  • 4,101
  • 11
  • 43
  • 88
1
vote
0 answers

spray-testkit: could not find implicit value for parameter ta:

First time spray user close to ripping hair out. trait SampleService extends SimpleRoutingApp with JsonProtocol with SprayJsonSupport { implicit val system: ActorSystem = ActorSystem("test") implicit def context: ExecutionContext =…
flavian
  • 28,161
  • 11
  • 65
  • 105
1
vote
1 answer

Spray.io test response not matching actual output

I'm trying to set up some tests for an API made by a coworker with spray.io, and I'm encountering some odd behavior. When a request results in an error for any reason, we want to return a JSON value along the lines…
childofsoong
  • 1,918
  • 16
  • 23
1
vote
0 answers

spray and actor non deterministic tests

Helo, at the beginning i wold like to apologize for my english :) akka=2.3.6 spray=1.3.2 scalatest=2.2.1 I encountered strange behavior of teting routes, which asks actors in handleWith directive, I've route with handleWith…
0
votes
1 answer

API testing akka-http REST endpoint

Here is my endpoint in akka-http: private val route = Route.asyncHandler( pathPrefix("v0") { headerValueByType[JWTTokenObject](()) { jwtHeader => mapRequest(authorize(jwtHeader.value)) { …
0
votes
1 answer

Adding headers in a Spray.io Test Spec fails to send the request into the route

I'm on Spray 1.3.3. I have a spec that looks like the following: "Add a collection using a PATCH with correct update hash" in { Patch("/datastore/collections/FMI", CollectionPatch(addPriceCodes = Some(List(PriceCode("AMI", "22", None))))) ~> …
djsumdog
  • 2,560
  • 1
  • 29
  • 55
0
votes
1 answer

Spray Routing Doesn't match anything

I have tried many things, but no matter what I do in my tests (which simply sends a PUT request to "create a user") the logs do not enter any of the pathPrefix and just go to the end and fail to match anything. Can anyone offer insight? Below is…
0
votes
1 answer

How to use Spray's logRequestResponse in tests with debug level?

I am trying to follow this advice to debug my Spray routes, i.e. using logRequestResponse. I am using debug logging level. However, no debug messages appear on the console.
Robin Green
  • 32,079
  • 16
  • 104
  • 187
0
votes
1 answer

Access request in Spray testkit test

I have an external validator library which needs access to both the request and the response in a test. The response is easy - I just need to write an implicit conversion to the Java interface the library wants - but I would like to write code that…
Robin Green
  • 32,079
  • 16
  • 104
  • 187
0
votes
1 answer

spray-testkit with scalatest, status doesn't work

I am trying to test a POST spray-route with scalatest which require a mandatory parameter adId. And Cannot make it work. My code follows import akka.actor._ import akka.event.LoggingReceive import akka.testkit.{TestProbe} import…
jaksky
  • 3,305
  • 4
  • 35
  • 68
0
votes
1 answer

How to use "eventually" with "Specs2RouteTest"

There are two specs here. First is not passing because eventually in check will not cause whole route rerun but this is the way I would prefer to follow. The second spec is the best solution I found (and prove that it is doable ;) ) but it contains…
panurg
  • 309
  • 4
  • 11
1
2