junit « jersey « Java Enterprise Q&A





1. What is the best way to write a test case for JERSEY web services?    stackoverflow.com

I have a JAX-RS web service implemented with Jersey library and now I want to test it. In order to do that I'd like to host this service in my test ...

2. Why would extending JerseyTest vs extending TestCase cause no tests to be found    stackoverflow.com

I am attempting to get the Jersey test framework working. We are building using maven 1.x. I've created the following testcase...

public class SomeResourceTest extends JerseyTest
{
    public ...

3. JerseyTest with ApacheHttpClient and GrizzlyWebTestContainer    stackoverflow.com

I am testing a web application that requires the client to retain cookies with session data. My preferred testing platform is Junit combined with JerseyTest and the Grizzly web container. By default, ...

4. Turn on gzip compression for grizzly under JerseyTest    stackoverflow.com

I have jersey implementation of web service. The response per requirements must be gzip-ed. Client side contains following bootstrap code to switch gzip on:

Client retval = Client.create();
retval.addFilter(
    new ...

5. How can I inject a data source dependency into a RESTful web service with Jersey (Test Framework)?    stackoverflow.com

I'm building a RESTful web service using Jersey that relies on MongoDB for persistence. The web service itself connects to the default database, but for the unit tests, I would like to ...

6. junit for REST webservice?    stackoverflow.com

I have a REST(jersey) service exposed which basically delegates the call to DAO to fetch some data from the DB and return it into JSON format, How to unit test the ...

7. Behaviour of JerseyTest Grizzly Web Server on Unix    stackoverflow.com

We have created a test suite and in order to run it we are using embedded Grizzly Web Server with JerseyTest framework. We are extending a custom class from JerseyTest and in ...

8. Junit Test for jersey (RESTful) @POST html form    stackoverflow.com

I am trying to write a junit test case for the method below:

@POST
@Produces(MediaType.APPLICATION_JSON)
@Path("writeStuff")
@Consumes("multipart/form-data")
public Response stuffToWrite(FormDataMultiPart formData) {
     ....
}
How do I simulate the html form? I am thinking ...

9. Unit testing Jersey Resources with Guice injected fields    stackoverflow.com

I have a Jersey Resource that I want to test with JUnit. The resource uses Guice Providers to inject certain fields:

@Path("/example/")
class ExampleResource {
    @Inject
    Provider<ExampleActionHandler> ...