Agree with Gili here. I do exactly that (though I have the advantage of
using Dropwizard, which makes testing via an embedded Jetty instance
trivial). And since you're using MongoDB, there's also the Embedded MongoDB
(
https://github.com/flapdoodle-oss/de.flapdoodle.embed.mongo) which helps
keep your tests isolated from one another.
;ted
--
Ted M. Young
about.me/tedmyoung
[image: Ted M. Young on about.me]
<http://about.me/tedmyoung>
On Wed, Sep 3, 2014 at 8:53 PM, cowwoc <cowwoc_at_bbs.darktech.org> wrote:
> In my experience, you're better interacting directly with an embedded
> server (such as Jetty) rather than using JerseyTest which attempts to
> abstract away the server. I've never really understood the point of
> abstracting away the server and I find their abstraction to be leaky (at
> least, this was the case in the past).
>
> Gili
>
>
> On 03/09/2014 10:26 PM, Paul O'Fallon wrote:
>
> Have you taken a look at JerseyTest? It supports many different
> containers, including an in-memory one...
>
> On Wednesday, September 3, 2014, Andre Perez <andre.perez1501_at_gmail.com>
> wrote:
>
>> I am using JDK 1.7, Jersey 2.12, Tomcat 7, MongoDB and RestAssured
>> <https://code.google.com/p/rest-assured/> to unit test my Rest calls...
>> The issue is that RestAssured needs Tomcat to be running with my war file,
>> in order, to work. Is there an embedded server or in-memory server along
>> with a different unit testing framework which I can use to test my Restful
>> Web Services (basically without be tightly coupled to an external server)?
>> Would love to hear people's suggestions regarding best practices?
>>
>
>