Search in sources :

Example 1 with HttpClient

use of com.braintreepayments.api.internal.HttpClient in project braintree_android by braintree.

the class BraintreeFragmentUnitTest method getBraintreeApiHttpClient_returnsExistingClientIfOneExists.

@Test
public void getBraintreeApiHttpClient_returnsExistingClientIfOneExists() throws Exception {
    String configuration = new TestConfigurationBuilder().braintreeApi(new TestBraintreeApiConfigurationBuilder().accessToken("some-token").url("http://braintree-api.com")).build();
    mockConfigurationManager(Configuration.fromJson(configuration));
    BraintreeFragment fragment = BraintreeFragment.newInstance(mActivity, TOKENIZATION_KEY);
    HttpClient client = fragment.getBraintreeApiHttpClient();
    HttpClient client2 = fragment.getBraintreeApiHttpClient();
    assertSame(client, client2);
}
Also used : TestBraintreeApiConfigurationBuilder(com.braintreepayments.testutils.TestConfigurationBuilder.TestBraintreeApiConfigurationBuilder) BraintreeHttpClient(com.braintreepayments.api.internal.BraintreeHttpClient) HttpClient(com.braintreepayments.api.internal.HttpClient) TestConfigurationBuilder(com.braintreepayments.testutils.TestConfigurationBuilder) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Aggregations

BraintreeHttpClient (com.braintreepayments.api.internal.BraintreeHttpClient)1 HttpClient (com.braintreepayments.api.internal.HttpClient)1 TestConfigurationBuilder (com.braintreepayments.testutils.TestConfigurationBuilder)1 TestBraintreeApiConfigurationBuilder (com.braintreepayments.testutils.TestConfigurationBuilder.TestBraintreeApiConfigurationBuilder)1 Test (org.junit.Test)1 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)1