Exemplo n.º 1
0
  @Test
  public void destroyOutboxDirectMessage() {
    try {
      Paging<User> paging = new Paging<User>();
      List<User> listUser = weibo.getFollowers(paging);
      assertTrue(ListUtil.isNotEmpty(listUser));

      User user = listUser.get(0);
      assertNotNull(user);

      String text = "测试删除私信接口:destroyOutboxDirectMessage,莫慌," + System.currentTimeMillis();
      DirectMessage message = weibo.sendDirectMessage(user.getDisplayName(), text);
      assertNotNull(message);
      assertTrue(StringUtil.isNotEmpty(message.getId()));

      TestUtil.sleep();

      DirectMessage deletedMessage = weibo.destroyOutboxDirectMessage(message.getId());
      assertNotNull(deletedMessage);
      assertTrue(StringUtil.isNotEmpty(deletedMessage.getId()));
    } catch (LibException e) {
      e.printStackTrace();
      assertTrue(false);
    }
  }
Exemplo n.º 2
0
  @Test
  public void destroyInboxDirectMessage() {
    try {
      Paging<DirectMessage> paging = new Paging<DirectMessage>();
      List<DirectMessage> listMessage = weibo.getInboxDirectMessages(paging);
      assertTrue(ListUtil.isNotEmpty(listMessage));
      DirectMessage message = listMessage.get(0);
      assertNotNull(message);

      TestUtil.sleep();

      DirectMessage deletedMessage = weibo.destroyInboxDirectMessage(message.getId());
      assertNotNull(deletedMessage);
      assertTrue(StringUtil.isNotEmpty(deletedMessage.getId()));
    } catch (Exception e) {
      e.printStackTrace();
      assertTrue(false);
    }
  }