Package net.minidev.json

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


    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

    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

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.