Skip to content

Commit

Permalink
Paypal Data Collector Module (#574)
Browse files Browse the repository at this point in the history
* Extract PayPalDataCollector module.

* Remove BraintreeDataCollector as Card dependency.

* Fix broken data collector unit test.

* Write initial spec for configuration fetch error forwarding in paypal data collector unit test.

* Update PayPalDataCollector to sue exceptions.

* Finish magnes internal client tests.

* Update pay pal data collector to use magnes internal client.

* Update paypal data collector to use magnes internal client.

* Cleanup unit tests.

* Update tests and clean up logic.

* Move PayPalDataCollector integration test to PayPalDataCollector module.

* Update paypal data collector build.gradle file.

* Update github actions to build and test paypal data collector.

* Add top-level docs comment to PayPalDataCollector class.

* Update CHANGELOG.

* Update PayPalDataCollector docstring.
  • Loading branch information
sshropshire authored Aug 5, 2022
1 parent 0059a90 commit d146546
Show file tree
Hide file tree
Showing 32 changed files with 769 additions and 322 deletions.
1 change: 1 addition & 0 deletions .github/actions/publish_all_modules/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ runs:
./gradlew clean \
:AmericanExpress:publishToSonatype \
:BraintreeCore:publishToSonatype \
:PayPalDataCollector:publishToSonatype \
:BraintreeDataCollector:publishToSonatype \
:Card:publishToSonatype \
:GooglePay:publishToSonatype \
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ jobs:
uses: ./.github/actions/unit_test_module
with:
module: BraintreeCore
unit_test_paypal_data_collector:
name: PayPalDataCollector Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Java 8
uses: ./.github/actions/setup
- name: Run Unit Tests
uses: ./.github/actions/unit_test_module
with:
module: PayPalDataCollector
unit_test_braintree_data_collector:
name: BraintreeDataCollector Unit Tests
runs-on: ubuntu-latest
Expand Down Expand Up @@ -204,6 +216,7 @@ jobs:
needs: [
unit_test_american_express,
unit_test_braintree_core,
unit_test_paypal_data_collector,
unit_test_braintree_data_collector,
unit_test_card,
unit_test_google_pay,
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/release_snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@ jobs:
uses: ./.github/actions/unit_test_module
with:
module: BraintreeCore
unit_test_paypal_data_collector:
name: PayPalDataCollector Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Java 8
uses: ./.github/actions/setup
- name: Run Unit Tests
uses: ./.github/actions/unit_test_module
with:
module: PayPalDataCollector
unit_test_braintree_data_collector:
name: BraintreeDataCollector Unit Tests
runs-on: ubuntu-latest
Expand Down Expand Up @@ -203,6 +215,7 @@ jobs:
needs: [
unit_test_american_express,
unit_test_braintree_core,
unit_test_paypal_data_collector,
unit_test_braintree_data_collector,
unit_test_card,
unit_test_google_pay,
Expand Down
2 changes: 1 addition & 1 deletion BraintreeDataCollector/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ android {

dependencies {
implementation files('libs/kount-data-collector-3.2.jar')
implementation files('libs/android-magnessdk-5.3.0.jar')

implementation deps.annotation
api project(':BraintreeCore')
implementation project(':PayPalDataCollector')

testImplementation deps.robolectric
testImplementation deps.mockitoCore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class DataCollector {
private final UUIDHelper uuidHelper;

public DataCollector(@NonNull BraintreeClient braintreeClient) {
this(braintreeClient, new PayPalDataCollector(), new KountDataCollector(braintreeClient), new UUIDHelper());
this(braintreeClient, new PayPalDataCollector(braintreeClient), new KountDataCollector(braintreeClient), new UUIDHelper());
}

@VisibleForTesting
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
package com.braintreepayments.api;

import static junit.framework.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.isNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import android.content.Context;

import com.braintreepayments.api.TestConfigurationBuilder.TestKountConfigurationBuilder;
Expand All @@ -12,14 +20,6 @@
import org.mockito.ArgumentCaptor;
import org.robolectric.RobolectricTestRunner;

import static junit.framework.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.isNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

@RunWith(RobolectricTestRunner.class)
public class DataCollectorUnitTest {

Expand Down
Loading

0 comments on commit d146546

Please sign in to comment.