Package net.unto.twitter.methods

Examples of net.unto.twitter.methods.Request.toUrl()


        .since(epoch).build();
    assertEquals("http://twitter.com:80/statuses/friends_timeline.json",
        request.toString());
    assertHasParameter(request.toUrl(), "count", "10");
    assertHasParameter(request.toUrl(), "page", "1");
    assertHasParameter(request.toUrl(), "since_id", "12345");
    assertHasParameter(request.toUrl(), "since",
        "Thu Jan 01 00:00:00 +0000 1970");
  }

  @Test
View Full Code Here


    assertEquals("http://twitter.com:80/statuses/friends_timeline.json",
        request.toString());
    assertHasParameter(request.toUrl(), "count", "10");
    assertHasParameter(request.toUrl(), "page", "1");
    assertHasParameter(request.toUrl(), "since_id", "12345");
    assertHasParameter(request.toUrl(), "since",
        "Thu Jan 01 00:00:00 +0000 1970");
  }

  @Test
  public void testLeaveRequestUrl() {
View Full Code Here

  public void testNewDirectMessageRequestUrl() {
    Api api = Api.builder().username("test").password("test").build();
    Request request = api.newDirectMessage("dewitt", "Hello, DeWitt").build();
    assertEquals("http://twitter.com:80/direct_messages/new.json", request
        .toString());
    assertHasParameter(request.toUrl(), "user", "dewitt");
    assertHasParameter(request.toUrl(), "text", "Hello, DeWitt");
  }

  @Test
  public void testPublicTimelineRequestUrl() {
View Full Code Here

    Api api = Api.builder().username("test").password("test").build();
    Request request = api.newDirectMessage("dewitt", "Hello, DeWitt").build();
    assertEquals("http://twitter.com:80/direct_messages/new.json", request
        .toString());
    assertHasParameter(request.toUrl(), "user", "dewitt");
    assertHasParameter(request.toUrl(), "text", "Hello, DeWitt");
  }

  @Test
  public void testPublicTimelineRequestUrl() {
    Api api = Api.builder().username("test").password("test").build();
View Full Code Here

    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.replies().page(1).sinceId(12345).since(epoch).build();
    assertEquals("http://twitter.com:80/statuses/replies.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

    DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeZone.UTC);
    Request request = api.replies().page(1).sinceId(12345).since(epoch).build();
    assertEquals("http://twitter.com:80/statuses/replies.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");
  }

  @Test
View Full Code Here

    Request request = api.replies().page(1).sinceId(12345).since(epoch).build();
    assertEquals("http://twitter.com:80/statuses/replies.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");
  }

  @Test
  public void testSearchRequestUrl() {
View Full Code Here

        -73.985506).setRadius(25).setUnit(Geocode.Unit.KILOMETERS).build();
    Request request = api.search("foo").geocode(geocode).page(1)
      .resultsPerPage(10).sinceId(12345).lang("en").showUser(true)
      .fromScreenName("dewitt").toScreenName("test").build();
    assertEquals("http://search.twitter.com:80/search.json", request.toString());
    assertHasParameter(request.toUrl(), "geocode", "40.757929,-73.985506,25km");
    assertHasParameter(request.toUrl(), "page", "1");
    assertHasParameter(request.toUrl(), "rpp", "10");
    assertHasParameter(request.toUrl(), "since_id", "12345");
    assertHasParameter(request.toUrl(), "lang", "en");
    assertHasParameter(request.toUrl(), "show_user", "true");
View Full Code Here

    Request request = api.search("foo").geocode(geocode).page(1)
      .resultsPerPage(10).sinceId(12345).lang("en").showUser(true)
      .fromScreenName("dewitt").toScreenName("test").build();
    assertEquals("http://search.twitter.com:80/search.json", request.toString());
    assertHasParameter(request.toUrl(), "geocode", "40.757929,-73.985506,25km");
    assertHasParameter(request.toUrl(), "page", "1");
    assertHasParameter(request.toUrl(), "rpp", "10");
    assertHasParameter(request.toUrl(), "since_id", "12345");
    assertHasParameter(request.toUrl(), "lang", "en");
    assertHasParameter(request.toUrl(), "show_user", "true");
    assertHasParameter(request.toUrl(), "from", "dewitt");
View Full Code Here

      .resultsPerPage(10).sinceId(12345).lang("en").showUser(true)
      .fromScreenName("dewitt").toScreenName("test").build();
    assertEquals("http://search.twitter.com:80/search.json", request.toString());
    assertHasParameter(request.toUrl(), "geocode", "40.757929,-73.985506,25km");
    assertHasParameter(request.toUrl(), "page", "1");
    assertHasParameter(request.toUrl(), "rpp", "10");
    assertHasParameter(request.toUrl(), "since_id", "12345");
    assertHasParameter(request.toUrl(), "lang", "en");
    assertHasParameter(request.toUrl(), "show_user", "true");
    assertHasParameter(request.toUrl(), "from", "dewitt");
    assertHasParameter(request.toUrl(), "to", "test");
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.