Search in sources :

Example 1 with TestPayPalConfigurationBuilder

use of com.braintreepayments.testutils.TestConfigurationBuilder.TestPayPalConfigurationBuilder in project braintree_android by braintree.

the class PayPalUnitTest method setup.

@Before
public void setup() throws Exception {
    spy(PayPal.class);
    doReturn(true).when(PayPal.class, "isManifestValid", any(Context.class));
    spy(Recipe.class);
    doReturn(true).when(Recipe.class, "isValidBrowserTarget", any(Context.class), anyString(), anyString());
    Authorization authorization = mock(Authorization.class);
    when(authorization.getBearer()).thenReturn("authorization");
    when(authorization.toString()).thenReturn("authorization");
    Configuration configuration = new TestConfigurationBuilder().withAnalytics().paypal(new TestPayPalConfigurationBuilder(true).environment("offline").billingAgreementsEnabled(false)).buildConfiguration();
    mMockFragmentBuilder = new MockFragmentBuilder().authorization(authorization).configuration(configuration);
}
Also used : Context(android.content.Context) Authorization(com.braintreepayments.api.models.Authorization) TestPayPalConfigurationBuilder(com.braintreepayments.testutils.TestConfigurationBuilder.TestPayPalConfigurationBuilder) Configuration(com.braintreepayments.api.models.Configuration) TestConfigurationBuilder(com.braintreepayments.testutils.TestConfigurationBuilder) Before(org.junit.Before)

Aggregations

Context (android.content.Context)1 Authorization (com.braintreepayments.api.models.Authorization)1 Configuration (com.braintreepayments.api.models.Configuration)1 TestConfigurationBuilder (com.braintreepayments.testutils.TestConfigurationBuilder)1 TestPayPalConfigurationBuilder (com.braintreepayments.testutils.TestConfigurationBuilder.TestPayPalConfigurationBuilder)1 Before (org.junit.Before)1