rest service & integration testing

40 views
Skip to first unread message

Lachlan Deck

unread,
Sep 5, 2015, 5:25:34 PM9/5/15
to Liftweb Group
Hi all,

is there a recommended way (or one that people use successfully) to do integration testing for liftweb rest services (whether via selenium or otherwise)—json? Something like dispatch?

I can see how to mock requests (https://www.assembla.com/spaces/liftweb/wiki/Mocking_HTTP_Requests), for a unit test, but… it’d be good to test against a running app too.

Perhaps it’s sbt that has me stumped. With maven, jetty could be bound to pre/post integration test phases (https://maven.apache.org/surefire/maven-failsafe-plugin/usage.html). 

Are people using a selenium driver for rest services of some kind?

Any repos I could peruse that have more than hello world? 

cheers,
Lachlan Deck

Antonio Salazar Cardozo

unread,
Sep 5, 2015, 6:12:12 PM9/5/15
to Lift
If you're going for full-on integration testing of a REST service, it seems
like probably this should be completely framework-independent? After
all, part of the point of a REST service is that the implementor of the API
is a black box, right? :)
Thanks,
Antonio

Lachlan Deck

unread,
Sep 6, 2015, 1:52:32 PM9/6/15
to lif...@googlegroups.com
That will be needed also, but I’m looking to fulfil standard TDD practices within the framework itself.

So any pointers / examples would be great.

cheers,
Lachlan Deck


--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code

---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Antonio Salazar Cardozo

unread,
Sep 6, 2015, 7:36:00 PM9/6/15
to Lift
Lift's RestHelpers are just PartialFunctions of Req to ()=>Box[LiftResponse]. So
you can unit test them by handing them a Req constructed to reflect the endpoint
you want to test. I don't believe I currently have any sample code handy, unfortunately;
someone else might be able to pitch in!
Thanks,
Antonio
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages