Jersey Test Framework 2.5 - test POST method

Viewed 14657

I'm trying to find some manual how to test POST methods using jersey framework, only got examples for GET method.

Here's example:

@POST
@Path("add")
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.APPLICATION_XML)
public Response addUser(JAXBElement<User> user) {

    int code = userService.addUser(user.getValue());
    if (code == 500) {
        return Response.status(500).build();
    }
    return Response.status(code).entity(user).build();

}

Could you please post some POST method test example? Thank you in advance.

1 Answers
Related