Package net.unto.twitter.methods

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


        .sourceScreenName("dewitt")
  .targetScreenName("ev")
  .build();
    assertEquals("http://twitter.com:80/friendships/show.json",
     requestWithoutAuthByScreenName.toString());
    assertHasParameter(requestWithoutAuthByScreenName.toUrl(), "source_screen_name", "dewitt");
    assertHasParameter(requestWithoutAuthByScreenName.toUrl(), "target_screen_name", "ev");
    api = Api.builder().username("test").password("test").build();
    Request requestWithAuthById = api.showFriendships()
  .targetId(20)
  .build();
View Full Code Here


  .targetScreenName("ev")
  .build();
    assertEquals("http://twitter.com:80/friendships/show.json",
     requestWithoutAuthByScreenName.toString());
    assertHasParameter(requestWithoutAuthByScreenName.toUrl(), "source_screen_name", "dewitt");
    assertHasParameter(requestWithoutAuthByScreenName.toUrl(), "target_screen_name", "ev");
    api = Api.builder().username("test").password("test").build();
    Request requestWithAuthById = api.showFriendships()
  .targetId(20)
  .build();
    assertEquals("http://twitter.com:80/friendships/show.json",
View Full Code Here

    Request requestWithAuthById = api.showFriendships()
  .targetId(20)
  .build();
    assertEquals("http://twitter.com:80/friendships/show.json",
     requestWithAuthById.toString());
    assertHasParameter(requestWithAuthById.toUrl(), "target_id", "20");
    Request requestWithAuthByScreenName = api.showFriendships()
  .targetScreenName("ev")
  .build();
    assertEquals("http://twitter.com:80/friendships/show.json",
     requestWithAuthByScreenName.toString());
View Full Code Here

    Request requestWithAuthByScreenName = api.showFriendships()
  .targetScreenName("ev")
  .build();
    assertEquals("http://twitter.com:80/friendships/show.json",
     requestWithAuthByScreenName.toString());
    assertHasParameter(requestWithAuthByScreenName.toUrl(), "target_screen_name", "ev");
  }

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

    assertEquals("http://twitter.com:80/users/show/dewitt.json", requestById
        .toString());
    Request requestByUserId = api.showUser().userId(12345).build();
    assertEquals("http://twitter.com:80/users/show.json", requestByUserId
        .toString());
    assertHasParameter(requestByUserId.toUrl(), "user_id", "12345");
    Request requestByScreenName = api.showUser().screenName("dewitt").build();
    assertEquals("http://twitter.com:80/users/show.json", requestByScreenName
        .toString());
    assertHasParameter(requestByScreenName.toUrl(), "screen_name", "dewitt");
  }
View Full Code Here

        .toString());
    assertHasParameter(requestByUserId.toUrl(), "user_id", "12345");
    Request requestByScreenName = api.showUser().screenName("dewitt").build();
    assertEquals("http://twitter.com:80/users/show.json", requestByScreenName
        .toString());
    assertHasParameter(requestByScreenName.toUrl(), "screen_name", "dewitt");
  }

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

  public void testUpdateDeliveryDeviceRequestUrl() {
    Api api = Api.builder().username("test").password("test").build();
    Request requestNone = api.updateDeliveryDevice(Device.NONE).build();
    assertEquals("http://twitter.com:80/account/update_delivery_device.json",
        requestNone.toString());
    assertHasParameter(requestNone.toUrl(), "device", "none");
    Request requestIm = api.updateDeliveryDevice(Device.IM).build();
    assertEquals("http://twitter.com:80/account/update_delivery_device.json",
        requestIm.toString());
    assertHasParameter(requestIm.toUrl(), "device", "im");
    Request requestSms = api.updateDeliveryDevice(Device.SMS).build();
View Full Code Here

        requestNone.toString());
    assertHasParameter(requestNone.toUrl(), "device", "none");
    Request requestIm = api.updateDeliveryDevice(Device.IM).build();
    assertEquals("http://twitter.com:80/account/update_delivery_device.json",
        requestIm.toString());
    assertHasParameter(requestIm.toUrl(), "device", "im");
    Request requestSms = api.updateDeliveryDevice(Device.SMS).build();
    assertEquals("http://twitter.com:80/account/update_delivery_device.json",
        requestSms.toString());
    assertHasParameter(requestSms.toUrl(), "device", "sms");
  }
View Full Code Here

        requestIm.toString());
    assertHasParameter(requestIm.toUrl(), "device", "im");
    Request requestSms = api.updateDeliveryDevice(Device.SMS).build();
    assertEquals("http://twitter.com:80/account/update_delivery_device.json",
        requestSms.toString());
    assertHasParameter(requestSms.toUrl(), "device", "sms");
  }

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

    Request request = api.updateProfileBackgroundImage(file).build();
    assertEquals(
        "http://twitter.com:80/account/update_profile_background_image.json",
        request.toString());
    byte[] bytes = FileUtils.readFileToByteArray(file);
    assertHasPart(request.toUrl(), "image", "profile_background_image.png", bytes, "image/png", FilePart.DEFAULT_CHARSET);
  }

  @Test
  public void testUpdateProfileColorsRequestUrl() {
    Api api = Api.builder().username("test").password("test").build();
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.