Advertisement
Guest User

Untitled

a guest
May 31st, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. @POST
  2. @Path("/config")
  3. @Consumes(MediaType.APPLICATION_JSON)
  4. public Response saveConfiguration(String name, MultivaluedMap<String, Object> properties) {
  5. return Response.ok().build();
  6. }
  7.  
  8. String payload = "{"name":"CRJ001","properties":{"expression":["a + b"],"baseClass":["org.carlspring.strongbox.crontask.test.MyTask"]}}";
  9. WebTarget resource = client.getClientInstance().target(path);
  10. Response response = resource.request(MediaType.APPLICATION_JSON).post(Entity.entity(payload, MediaType.APPLICATION_JSON));
  11.  
  12. int status = response.getStatus();
  13. assertEquals("Failed to save!", Response.ok().build().getStatus(), status);
  14.  
  15. [[FATAL] Method public javax.ws.rs.core.Response org.abc.rest.ConfigurationRestlet.saveConfiguration(java.lang.String,javax.ws.rs.core.
  16. MultivaluedMap) on resource class org.abc.rest.ConfigurationRestlet contains multiple parameters with no annotation. Unable to resolve
  17. the injection source.;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement