Package com.linkedin.restli.server

Examples of com.linkedin.restli.server.UpdateResponse


    addParams(delete, ResourceMethod.BATCH_DELETE);
    addPathKeys(delete);
    BatchDeleteRequest<Object, RecordTemplatePlaceholder> request = delete.build();

    final Map<Object, UpdateResponse> bdResponseData = new HashMap<Object, UpdateResponse>();
    bdResponseData.put(id1, new UpdateResponse(HttpStatus.S_200_OK));
    bdResponseData.put(id2, new UpdateResponse(HttpStatus.S_200_OK));
    BatchUpdateResult<Object, RecordTemplatePlaceholder> result = new BatchUpdateResult<Object, RecordTemplatePlaceholder>(bdResponseData);
    return buildRequestResponse(request, result, buildResourceMethodDescriptorForRestMethod(request));
  }
View Full Code Here


{
  @RestMethod.Delete
  @PartialInclusiveAnnotation(used = 1, unused = "this value is ununsed")
  public UpdateResponse delete(Long key)
  {
    return new UpdateResponse(HttpStatus.S_204_NO_CONTENT);
  }
View Full Code Here

    final Long id = createPhoto();

    final LatLong l1 = new LatLong().setLongitude(-27.0f);
    final EXIF e1 = new EXIF().setLocation(l1);
    final Photo p1 = new Photo().setExif(e1);
    final UpdateResponse uResp = _res.update(id, p1);
    Assert.assertEquals(uResp.getStatus(), HttpStatus.S_204_NO_CONTENT);

    // validate data is changed to correct value
    final Photo p2 = _res.get(id);
    Assert.assertNotNull(p2.hasExif());
    final EXIF e2 = p2.getExif();
View Full Code Here

  public void testResourceDelete()
  {
    final Long id = createPhoto();

    // validate response status code
    final UpdateResponse uResp = _res.delete(id);
    Assert.assertEquals(uResp.getStatus(), HttpStatus.S_204_NO_CONTENT);
  }
View Full Code Here

  {
    final Long id = createPhoto("PartialTestPhoto");
    final String newTitle = "The New Title";
    final Photo p = new Photo().setTitle(newTitle);
    final PatchRequest<Photo> patch = PatchGenerator.diffEmpty(p);
    final UpdateResponse uResp = _res.update(id, patch);

    final Photo updatedPhoto = _res.get(id);
    Assert.assertEquals(updatedPhoto.getTitle(), newTitle);
    Assert.assertEquals(uResp.getStatus(), HttpStatus.S_202_ACCEPTED);
  }
View Full Code Here

TOP

Related Classes of com.linkedin.restli.server.UpdateResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.