Search in sources :

Example 1 with TestAndroidPayConfigurationBuilder

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

the class AndroidPayTest method setup.

@Before
public void setup() {
    mLatch = new CountDownLatch(1);
    mBaseConfiguration = new TestConfigurationBuilder().androidPay(new TestAndroidPayConfigurationBuilder().googleAuthorizationFingerprint("google-auth-fingerprint")).merchantId("android-pay-merchant-id");
}
Also used : TestAndroidPayConfigurationBuilder(com.braintreepayments.testutils.TestConfigurationBuilder.TestAndroidPayConfigurationBuilder) CountDownLatch(java.util.concurrent.CountDownLatch) TestConfigurationBuilder(com.braintreepayments.testutils.TestConfigurationBuilder) Before(org.junit.Before)

Example 2 with TestAndroidPayConfigurationBuilder

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

the class AndroidPayTest method isReadyToPay_returnsFalseWhenAndroidPayIsNotEnabled.

@Test(timeout = 5000)
public void isReadyToPay_returnsFalseWhenAndroidPayIsNotEnabled() throws Exception {
    String configuration = new TestConfigurationBuilder().androidPay(new TestAndroidPayConfigurationBuilder().enabled(false)).build();
    BraintreeFragment fragment = getFragment(mActivityTestRule.getActivity(), TOKENIZATION_KEY, configuration);
    AndroidPay.isReadyToPay(fragment, new BraintreeResponseListener<Boolean>() {

        @Override
        public void onResponse(Boolean isReadyToPay) {
            assertFalse(isReadyToPay);
            mLatch.countDown();
        }
    });
    mLatch.await();
}
Also used : TestAndroidPayConfigurationBuilder(com.braintreepayments.testutils.TestConfigurationBuilder.TestAndroidPayConfigurationBuilder) TestConfigurationBuilder(com.braintreepayments.testutils.TestConfigurationBuilder) Test(org.junit.Test)

Example 3 with TestAndroidPayConfigurationBuilder

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

the class GooglePaymentTest method isReadyToPay_returnsFalseWhenAndroidPayIsNotEnabled.

@Test(timeout = 5000)
public void isReadyToPay_returnsFalseWhenAndroidPayIsNotEnabled() throws Exception {
    String configuration = new TestConfigurationBuilder().androidPay(new TestAndroidPayConfigurationBuilder().enabled(false)).build();
    BraintreeFragment fragment = getFragment(mActivityTestRule.getActivity(), TOKENIZATION_KEY, configuration);
    GooglePayment.isReadyToPay(fragment, new BraintreeResponseListener<Boolean>() {

        @Override
        public void onResponse(Boolean isReadyToPay) {
            assertFalse(isReadyToPay);
            mLatch.countDown();
        }
    });
    mLatch.await();
}
Also used : TestAndroidPayConfigurationBuilder(com.braintreepayments.testutils.TestConfigurationBuilder.TestAndroidPayConfigurationBuilder) TestConfigurationBuilder(com.braintreepayments.testutils.TestConfigurationBuilder) Test(org.junit.Test)

Example 4 with TestAndroidPayConfigurationBuilder

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

the class GooglePaymentTest method setup.

@Before
public void setup() {
    mLatch = new CountDownLatch(1);
    mBaseConfiguration = new TestConfigurationBuilder().androidPay(new TestAndroidPayConfigurationBuilder().googleAuthorizationFingerprint("google-auth-fingerprint")).merchantId("android-pay-merchant-id");
}
Also used : TestAndroidPayConfigurationBuilder(com.braintreepayments.testutils.TestConfigurationBuilder.TestAndroidPayConfigurationBuilder) CountDownLatch(java.util.concurrent.CountDownLatch) TestConfigurationBuilder(com.braintreepayments.testutils.TestConfigurationBuilder) Before(org.junit.Before)

Aggregations

TestConfigurationBuilder (com.braintreepayments.testutils.TestConfigurationBuilder)4 TestAndroidPayConfigurationBuilder (com.braintreepayments.testutils.TestConfigurationBuilder.TestAndroidPayConfigurationBuilder)4 CountDownLatch (java.util.concurrent.CountDownLatch)2 Before (org.junit.Before)2 Test (org.junit.Test)2