Package org.jboss.aerogear.android.impl.core

Examples of org.jboss.aerogear.android.impl.core.HttpProviderFactory


    @Test
    public void runReadWithFilterUsingUri() throws Exception {

        final CountDownLatch latch = new CountDownLatch(1);

        HttpProviderFactory factory = mock(HttpProviderFactory.class);
        when(factory.get(anyObject())).thenReturn(mock(HttpProvider.class));

        RestAdapter<Data> adapter = new RestAdapter<Data>(Data.class, url);
        Object restRunner = UnitTestUtils.getPrivateField(adapter, "restRunner");
        UnitTestUtils.setPrivateField(restRunner, "httpProviderFactory", factory);
View Full Code Here


    @Test
    public void runReadWithFilterAndAuthentication() throws Exception {

        final CountDownLatch latch = new CountDownLatch(1);

        HttpProviderFactory factory = mock(HttpProviderFactory.class);
        HttpProvider provider = mock(HttpProvider.class);
        HeaderAndBody headerAndBody = mock(HeaderAndBody.class);
        when(headerAndBody.getBody()).thenReturn("".getBytes());
        when(provider.get()).thenReturn(headerAndBody);
        when(factory.get(anyObject(), anyObject())).thenReturn(provider);

        AuthorizationFields authFields = new AuthorizationFields();
        authFields.addQueryParameter("token", "token");

        AuthenticationModule urlModule = mock(AuthenticationModule.class);
View Full Code Here

TOP

Related Classes of org.jboss.aerogear.android.impl.core.HttpProviderFactory

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.