Package net.unto.twitter.methods

Examples of net.unto.twitter.methods.Request


public class ApiTest {

  @Test
  public void testCreateBlockRequestUrl() {
    Api api = Api.builder().username("test").password("test").build();
    Request request = api.createBlock("dewitt").build();
    assertEquals("http://twitter.com:80/blocks/create/dewitt.json", request.toString());
  }
View Full Code Here


  }

  @Test
  public void testCreateFavoriteRequestUrl() {
    Api api = Api.builder().username("test").password("test").build();
    Request request = api.createFavorite(12345).build();
    assertEquals("http://twitter.com:80/favorites/create/12345.json", request.toString());
  }
View Full Code Here

  }

  @Test
  public void testCreateFriendshipRequestUrl() {
    Api api = Api.builder().username("test").password("test").build();
    Request request = api.createFriendship("dewitt").build();
    assertEquals("http://twitter.com:80/friendships/create/dewitt.json", request.toString());
  }
View Full Code Here

  }

  @Test
  public void testDestroyBlockRequestUrl() {
    Api api = Api.builder().username("test").password("test").build();
    Request request = api.destroyBlock("dewitt").build();
    assertEquals("http://twitter.com:80/blocks/destroy/dewitt.json", request.toString());
  }
View Full Code Here

  }

  @Test
  public void testDestroyDirectMessageRequestUrl() {
    Api api = Api.builder().username("test").password("test").build();
    Request request = api.destroyDirectMessage(12345).build();
    assertEquals("http://twitter.com:80/direct_messages/destroy/12345.json", request.toString());
  }
View Full Code Here

  }

  @Test
  public void testDestroyFavoriteRequestUrl() {
    Api api = Api.builder().username("test").password("test").build();
    Request request = api.destroyFavorite(12345).build();
    assertEquals("http://twitter.com:80/favorites/destroy/12345.json", request.toString());
  }
View Full Code Here

  }

  @Test
  public void testDestroyFriendshipRequestUrl() {
    Api api = Api.builder().username("test").password("test").build();
    Request request = api.destroyFriendship("dewitt").build();
    assertEquals("http://twitter.com:80/friendships/destroy/dewitt.json", request.toString());
  }
View Full Code Here

  }

  @Test
  public void testDestroyStatusRequestUrl() {
    Api api = Api.builder().username("test").password("test").build();
    Request request = api.destroyStatus(12345).build();
    assertEquals("http://twitter.com:80/statuses/destroy/12345.json", request.toString());
  }
View Full Code Here

 
  @Test
  public void testDirectMessagesRequestUrl() {
    Api api = Api.builder().username("test").password("test").build();
    DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeZone.UTC);
    Request request = api.directMessages().page(1).sinceId(12345).since(epoch).build();
    assertEquals("http://twitter.com:80/direct_messages.json", request.toString());
    assertHasParameter(request.toUrl(), "page", "1");
    assertHasParameter(request.toUrl(), "since_id", "12345");
    assertHasParameter(request.toUrl(), "since",
        "Thu Jan 01 00:00:00 +0000 1970");
  }
View Full Code Here

  }

  @Test
  public void testEndSessionRequestUrl() {
    Api api = Api.builder().username("test").password("test").build();
    Request request = api.endSession().build();
    assertEquals("http://twitter.com:80/account/end_session.json", request.toString());
  }
View Full Code Here

TOP

Related Classes of net.unto.twitter.methods.Request

Copyright © 2018 www.massapicom. 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.