Package net.minidev.json

Examples of net.minidev.json.JSONObject.toJSONString()


        logstashEvent.put("@source_path", source_path);
        logstashEvent.put("@message", message);
        logstashEvent.put("@tags", tags);
        logstashEvent.put("@fields",additionalFields);

        return logstashEvent.toJSONString();
    }

    public String getSource() {
        return source;
    }
View Full Code Here


        if (!(null == tagz)) {
            jsonEvent.put("tags",tagz);
        }

        return jsonEvent.toJSONString();
    }
}
View Full Code Here

        }

        Resource resource = new ErrorResource(DomainErrors.Errors.STATUS_SERVER_ERROR, "server_error");
        JSONObject serverError = ResponseBuilder.build(resource);

        return Response.status(200).entity(serverError.toJSONString()).build();
  }
   

}
View Full Code Here

    JWKSet privateSet = new JWKSet(keyList);

    final boolean publicParamsOnly = true;
    JSONObject jsonObject = privateSet.toJSONObject(publicParamsOnly);

    JWKSet publicSet = JWKSet.parse(jsonObject.toJSONString());

    assertEquals(0, publicSet.getKeys().size());
  }

View Full Code Here

    throws Exception {

    JSONObject o = new JSONObject();
    o.put("aud", "http://example.com");

    ReadOnlyJWTClaimsSet jwtClaimsSet = JWTClaimsSet.parse(o.toJSONString());

    assertEquals("http://example.com", jwtClaimsSet.getAudience().get(0));
    assertEquals(1, jwtClaimsSet.getAudience().size());
  }
View Full Code Here

    throws Exception {

    JSONObject o = new JSONObject();
    o.put("aud", Arrays.asList("http://example.com"));

    ReadOnlyJWTClaimsSet jwtClaimsSet = JWTClaimsSet.parse(o.toJSONString());

    assertEquals("http://example.com", jwtClaimsSet.getAudience().get(0));
    assertEquals(1, jwtClaimsSet.getAudience().size());
  }
View Full Code Here

    throws Exception {

    JSONObject o = new JSONObject();
    o.put("aud", Arrays.asList("http://example.com", "http://example2.com"));

    ReadOnlyJWTClaimsSet jwtClaimsSet = JWTClaimsSet.parse(o.toJSONString());

    assertEquals("http://example.com", jwtClaimsSet.getAudience().get(0));
    assertEquals("http://example2.com", jwtClaimsSet.getAudience().get(1));
    assertEquals(2, jwtClaimsSet.getAudience().size());
  }
View Full Code Here

    JSONObject jsonObject = claimsSet.toJSONObject();

    assertEquals("123", (String)jsonObject.get("aud"));
    assertEquals(1, jsonObject.size());

    claimsSet = JWTClaimsSet.parse(jsonObject.toJSONString());
    assertEquals("123", claimsSet.getAudience().get(0));
    assertEquals(1, claimsSet.getAudience().size());
  }
}
View Full Code Here

    JSONObject summary = new JSONObject();
    summary.put("numVertices", numVertices);
    summary.put("numOwnVertices", numOwnVertices);
    out.collect(new Text("partition" + key.get() + " meta"),
        new Text(summary.toJSONString()));
  }

  @Override
  public void close() throws IOException {
  }
View Full Code Here

    jsonObject.put("token_endpoint_auth_signing_alg_values_supported", stringList);


    try {
      OIDCProviderMetadata.parse(jsonObject.toJSONString());

      fail("Failed to raise ParseException");

    } catch (ParseException e) {
      // ok
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.