Example #1
0
  @Test
  public void testTypeLiteralMap() throws Exception {
    JsonCodec<Map<String, Person>> jsonCodec = jsonCodec(new TypeLiteral<Map<String, Person>>() {});

    Person.validatePersonMapJsonCodec(jsonCodec);
  }
Example #2
0
  @Test
  public void testMapJsonCodecFromJsonCodec() throws Exception {
    JsonCodec<Map<String, Person>> jsonCodec = mapJsonCodec(String.class, jsonCodec(Person.class));

    Person.validatePersonMapJsonCodec(jsonCodec);
  }
Example #3
0
  @Test
  public void testListJsonCodecFromJsonCodec() throws Exception {
    JsonCodec<List<Person>> jsonCodec = listJsonCodec(jsonCodec(Person.class));

    Person.validatePersonListJsonCodec(jsonCodec);
  }
Example #4
0
  @Test
  public void testTypeLiteralList() throws Exception {
    JsonCodec<List<Person>> jsonCodec = jsonCodec(new TypeLiteral<List<Person>>() {});

    Person.validatePersonListJsonCodec(jsonCodec);
  }
Example #5
0
  @Test
  public void testJsonCodec() throws Exception {
    JsonCodec<Person> jsonCodec = jsonCodec(Person.class);

    Person.validatePersonJsonCodec(jsonCodec);
  }