Package com.google.nigori.common.NigoriMessages

Examples of com.google.nigori.common.NigoriMessages.GetRequest


    @Override
    public void handle(HttpServletRequest req, HttpServletResponse resp) throws ServletException,
        IOException, JsonConversionException, NotFoundException, UnauthorisedException {

      String json = getJsonAsString(req, maxJsonQueryLength);
      GetRequest request = MessageLibrary.getRequestFromJson(json);
      GetResponse response = protocol.get(request);

      String jsonresponse = MessageLibrary.toJson(response);
      resp.setContentType(MessageLibrary.MIMETYPE_JSON);
      resp.setCharacterEncoding(MessageLibrary.CHARSET);
View Full Code Here


  @Test
  public void testJSONGetRequestWithCorrectFieldsButCorruptedValues() throws Exception {

    // Build a broken version of the JSON request which has valid keys but invalid values
    byte[] key = toBytes("a key");
    GetRequest get =
        MessageLibrary.getRequestAsProtobuf(serverName, keyManager.signer(), key, null);
    Map<FieldDescriptor, Object> fieldMap = get.getAllFields();

    StringBuilder json = new StringBuilder();
    String invalidValue = "not a base64 encoded value due to incorrect symbols: ~`'|";
    json.append('{');
    for (FieldDescriptor f : fieldMap.keySet()) {
View Full Code Here

TOP

Related Classes of com.google.nigori.common.NigoriMessages.GetRequest

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.