Examples of HttpFetcher


Examples of com.findwise.utils.http.HttpFetcher

  @Override
  public void init() throws RequiredArgumentMissingException, InitFailedException {
    super.init();
    if(fetcher == null) {
      fetcher = new HttpFetcher(getSettings());
    }
  }
View Full Code Here

Examples of com.google.wave.api.AbstractRobot.HttpFetcher

  }

  private final List<EventType> calledEvents = new ArrayList<EventType>();

  public void testSubmit() throws Exception {
    HttpFetcher fetcher = mock(HttpFetcher.class);
    when(fetcher.send(contains("http://gmodules.com/api/rpc"),
        eq(AbstractRobot.JSON_MIME_TYPE),
        contains("wave.robot.notifyCapabilitiesHash")))
        .thenReturn("[{\"id\":\"op1\",\"data\":{}}]");

    AbstractRobot robot = new MockRobot(fetcher);
View Full Code Here

Examples of com.google.wave.api.WaveService.HttpFetcher

  }

  private final List<EventType> calledEvents = new ArrayList<EventType>();

  public void testSubmit() throws Exception {
    HttpFetcher fetcher = mock(HttpFetcher.class);
    when(fetcher.execute(any(HttpMessage.class), anyMapOf(String.class, Object.class)))
        .thenReturn(new HttpResponse("POST", new URL("http://foo.google.com"), 0,
            new ByteArrayInputStream("[{\"id\":\"op1\",\"data\":{}}]".getBytes())));


    MockRobot robot = new MockRobot();
View Full Code Here

Examples of org.apache.shindig.gadgets.http.HttpFetcher

  @Test
  public void testGetTamperedRawContent() throws Exception {
    byte[] raw = { 0, 1, 2, 3, 4, 5 };
    MakeRequestClient client = makeSignedFetchClient("o", "v", "http://www.example.com/app");
    // Tamper with the body before it hits the service provider
    client.setNextFetcher(new HttpFetcher() {
      public HttpResponse fetch(HttpRequest request) throws GadgetException {
        request.setPostBody("yo momma".getBytes());
        return serviceProvider.fetch(request);
      }
    });
View Full Code Here

Examples of org.apache.shindig.gadgets.http.HttpFetcher

  @Test(expected=RuntimeException.class)
  public void testGetTamperedFormContent() throws Exception {
    MakeRequestClient client = makeSignedFetchClient("o", "v", "http://www.example.com/app");
    // Tamper with the body before it hits the service provider
    client.setNextFetcher(new HttpFetcher() {
      public HttpResponse fetch(HttpRequest request) throws GadgetException {
        request.setPostBody("foo=quux".getBytes());
        return serviceProvider.fetch(request);
      }
    });
View Full Code Here

Examples of org.apache.shindig.gadgets.http.HttpFetcher

  @Test(expected=RuntimeException.class)
  public void testGetTamperedRemoveRawContent() throws Exception {
    byte[] raw = { 0, 1, 2, 3, 4, 5 };
    MakeRequestClient client = makeSignedFetchClient("o", "v", "http://www.example.com/app");
    // Tamper with the body before it hits the service provider
    client.setNextFetcher(new HttpFetcher() {
      public HttpResponse fetch(HttpRequest request) throws GadgetException {
        request.setPostBody(ArrayUtils.EMPTY_BYTE_ARRAY);
        request.setHeader("Content-Type", "application/x-www-form-urlencoded");
        return serviceProvider.fetch(request);
      }
View Full Code Here

Examples of org.apache.shindig.gadgets.http.HttpFetcher

  @Test(expected=RuntimeException.class)
  public void testPostTamperedRawContent() throws Exception {
    byte[] raw = { 0, 1, 2, 3, 4, 5 };
    MakeRequestClient client = makeSignedFetchClient("o", "v", "http://www.example.com/app");
    // Tamper with the body before it hits the service provider
    client.setNextFetcher(new HttpFetcher() {
      public HttpResponse fetch(HttpRequest request) throws GadgetException {
        request.setPostBody("yo momma".getBytes());
        return serviceProvider.fetch(request);
      }
    });
View Full Code Here

Examples of org.apache.shindig.gadgets.http.HttpFetcher

  @Test(expected=RuntimeException.class)
  public void testPostTamperedFormContent() throws Exception {
    MakeRequestClient client = makeSignedFetchClient("o", "v", "http://www.example.com/app");
    // Tamper with the body before it hits the service provider
    client.setNextFetcher(new HttpFetcher() {
      public HttpResponse fetch(HttpRequest request) throws GadgetException {
        request.setPostBody("foo=quux".getBytes());
        return serviceProvider.fetch(request);
      }
    });
View Full Code Here

Examples of org.apache.shindig.gadgets.http.HttpFetcher

  @Test(expected=RuntimeException.class)
  public void testPostTamperedRemoveRawContent() throws Exception {
    byte[] raw = { 0, 1, 2, 3, 4, 5 };
    MakeRequestClient client = makeSignedFetchClient("o", "v", "http://www.example.com/app");
    // Tamper with the body before it hits the service provider
    client.setNextFetcher(new HttpFetcher() {
      public HttpResponse fetch(HttpRequest request) throws GadgetException {
        request.setPostBody(ArrayUtils.EMPTY_BYTE_ARRAY);
        request.setHeader("Content-Type", "application/x-www-form-urlencoded");
        return serviceProvider.fetch(request);
      }
View Full Code Here

Examples of org.apache.shindig.gadgets.http.HttpFetcher

    final Provider<OAuth2Message> oauth2MessageProvider = EasyMock.createMock(Provider.class);
    final List<ClientAuthenticationHandler> clientAuthenticationHandlers = EasyMock
        .createMock(List.class);
    final List<TokenEndpointResponseHandler> tokenEndpointResponseHandlers = EasyMock
        .createMock(List.class);
    final HttpFetcher fetcher = EasyMock.createMock(HttpFetcher.class);

    EasyMock.replay(oauth2MessageProvider);
    EasyMock.replay(clientAuthenticationHandlers);
    EasyMock.replay(tokenEndpointResponseHandlers);
    EasyMock.replay(fetcher);
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.