@Test
  public void testParseTrendStatus() throws Exception {
    String content = readResource("/weiboclient4j/model/trend_status.json");

    TrendStatus status = JsonUtils.parseJsonObject(content, TrendStatus.class);
    assertNotNull(status);
    assertTrue(status.isFollow());
  }
Ejemplo n.º 2
0
  @Test
  public void testParseCountry() throws Exception {
    String content = readResource("/weiboclient4j/model/country.json");
    List<Map<String, String>> result =
        JsonUtils.parseJsonObject(content, new TypeReference<List<Map<String, String>>>() {});

    assertNotNull(result);
    assertEquals(2, result.size());

    assertTrue(result.get(0).containsKey("001"));
    assertEquals("C1", result.get(0).get("001"));

    assertTrue(result.get(1).containsKey("002"));
    assertEquals("C2", result.get(1).get("002"));
  }