Skip to content

Commit c99a29d

Browse files
committed
lint
1 parent 4871a56 commit c99a29d

File tree

6 files changed

+43
-21
lines changed

6 files changed

+43
-21
lines changed

DataCollector/src/test/java/com/braintreepayments/api/datacollector/DataCollectorUnitTest.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@ class DataCollectorUnitTest {
264264
}
265265

266266
@Test
267-
fun collectDeviceData_without_DataCollectorRequest_sets_hasUserLocationConsent_to_false() = runTest(testDispatcher) {
267+
fun collectDeviceData_without_DataCollectorRequest_sets_hasUserLocationConsent_to_false() =
268+
runTest(testDispatcher) {
268269
val braintreeClient = MockkBraintreeClientBuilder()
269270
.configurationSuccess(configuration)
270271
.build()
@@ -289,7 +290,8 @@ class DataCollectorUnitTest {
289290
}
290291

291292
@Test
292-
fun collectDeviceData_with_DataCollectorRequest_sets_correct_values_for_getClientMetadataId() = runTest(testDispatcher) {
293+
fun collectDeviceData_with_DataCollectorRequest_sets_correct_values_for_getClientMetadataId() =
294+
runTest(testDispatcher) {
293295
val braintreeClient = MockkBraintreeClientBuilder()
294296
.configurationSuccess(configuration)
295297
.build()
@@ -476,7 +478,8 @@ class DataCollectorUnitTest {
476478
}
477479

478480
@Test
479-
fun collectDeviceDataOnSuccess_withDataCollectorRequest_setsCorrectValuesForGetClientMetadataIdWithCallback() = runTest(testDispatcher) {
481+
fun collectDeviceDataOnSuccess_withDataCollectorRequest_setsCorrectValuesForGetClientMetadataIdWithCallback() =
482+
runTest(testDispatcher) {
480483
val braintreeClient = MockkBraintreeClientBuilder()
481484
.configurationSuccess(configuration)
482485
.build()

GooglePay/src/test/java/com/braintreepayments/api/googlepay/GooglePayClientUnitTest.kt

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ class GooglePayClientUnitTest {
116116
}
117117

118118
@Test
119-
fun isReadyToPay_whenExistingPaymentMethodRequired_sendsIsReadyToPayRequestWithExistingPaymentRequired() = runTest(testDispatcher) {
119+
fun isReadyToPay_whenExistingPaymentMethodRequired_sendsIsReadyToPayRequestWithExistingPaymentRequired() =
120+
runTest(testDispatcher) {
120121
val readyForGooglePayRequest = ReadyForGooglePayRequest().apply {
121122
isExistingPaymentMethodRequired = true
122123
}
@@ -767,7 +768,8 @@ class GooglePayClientUnitTest {
767768
}
768769

769770
@Test
770-
fun createPaymentAuthRequest_whenGooglePayCanProcessPayPal_tokenizationPropertiesIncludePayPal() = runTest(testDispatcher) {
771+
fun createPaymentAuthRequest_whenGooglePayCanProcessPayPal_tokenizationPropertiesIncludePayPal() =
772+
runTest(testDispatcher) {
771773
val configuration = Configuration.fromJson(TestConfigurationBuilder()
772774
.googlePay(
773775
TestConfigurationBuilder.TestGooglePayConfigurationBuilder()
@@ -819,7 +821,8 @@ class GooglePayClientUnitTest {
819821
}
820822

821823
@Test
822-
fun createPaymentAuthRequest_whenPayPalDisabledByRequest_tokenizationPropertiesLackPayPal() = runTest(testDispatcher) {
824+
fun createPaymentAuthRequest_whenPayPalDisabledByRequest_tokenizationPropertiesLackPayPal() =
825+
runTest(testDispatcher) {
823826
val configuration = Configuration.fromJson(TestConfigurationBuilder()
824827
.googlePay(
825828
TestConfigurationBuilder.TestGooglePayConfigurationBuilder()
@@ -871,7 +874,8 @@ class GooglePayClientUnitTest {
871874
}
872875

873876
@Test
874-
fun createPaymentAuthRequest_whenPayPalDisabledAndGooglePayHasPayPalClientId_tokenizationPropsContainPayPal() = runTest(testDispatcher) {
877+
fun createPaymentAuthRequest_whenPayPalDisabledAndGooglePayHasPayPalClientId_tokenizationPropsContainPayPal() =
878+
runTest(testDispatcher) {
875879
val configuration = Configuration.fromJson(TestConfigurationBuilder()
876880
.googlePay(
877881
TestConfigurationBuilder.TestGooglePayConfigurationBuilder()
@@ -995,7 +999,8 @@ class GooglePayClientUnitTest {
995999
}
9961000

9971001
@Test
998-
fun createPaymentAuthRequest_whenGooglePayConfigurationLacksClientId_tokenizationPropertiesLackPayPal() = runTest(testDispatcher) {
1002+
fun createPaymentAuthRequest_whenGooglePayConfigurationLacksClientId_tokenizationPropertiesLackPayPal() =
1003+
runTest(testDispatcher) {
9991004
val configuration = Configuration.fromJson(TestConfigurationBuilder()
10001005
.googlePay(
10011006
TestConfigurationBuilder.TestGooglePayConfigurationBuilder()
@@ -1046,7 +1051,8 @@ class GooglePayClientUnitTest {
10461051
}
10471052

10481053
@Test
1049-
fun createPaymentAuthRequest_whenConfigurationContainsElo_addsEloAndEloDebitToAllowedPaymentMethods() = runTest(testDispatcher) {
1054+
fun createPaymentAuthRequest_whenConfigurationContainsElo_addsEloAndEloDebitToAllowedPaymentMethods() =
1055+
runTest(testDispatcher) {
10501056
val configuration = Configuration.fromJson(TestConfigurationBuilder()
10511057
.googlePay(
10521058
TestConfigurationBuilder.TestGooglePayConfigurationBuilder()

LocalPayment/src/test/java/com/braintreepayments/api/localpayment/LocalPaymentClientUnitTest.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,8 @@ class LocalPaymentClientUnitTest {
390390
}
391391

392392
@Test
393-
fun createPaymentAuthRequest_whenCreatePaymentMethodSuccess_returnsLocalPaymentResultToCallback() = runTest(testDispatcher) {
393+
fun createPaymentAuthRequest_whenCreatePaymentMethodSuccess_returnsLocalPaymentResultToCallback() =
394+
runTest(testDispatcher) {
394395
val localPaymentApi = MockkLocalPaymentApiBuilder()
395396
.createPaymentMethodSuccess(localPaymentAuthRequestParams)
396397
.build()
@@ -828,7 +829,8 @@ class LocalPaymentClientUnitTest {
828829

829830
@Test
830831
@Throws(JSONException::class)
831-
fun onBrowserSwitchResult_sends_the_correct_value_of_hasUserLocationConsent_to_getClientMetadataId() = runTest(testDispatcher) {
832+
fun onBrowserSwitchResult_sends_the_correct_value_of_hasUserLocationConsent_to_getClientMetadataId() =
833+
runTest(testDispatcher) {
832834
val browserSwitchResult = mockk<BrowserSwitchFinalResult.Success>(relaxed = true)
833835
every { browserSwitchResult.requestMetadata } returns JSONObject()
834836
.put("payment-type", "ideal")

PayPal/src/test/java/com/braintreepayments/api/paypal/PayPalClientUnitTest.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,8 @@ class PayPalClientUnitTest {
407407
}
408408

409409
@Test
410-
fun createPaymentAuthRequest_whenCheckoutRequest_whenConfigError_forwardsErrorToListener() = runTest(testDispatcher) {
410+
fun createPaymentAuthRequest_whenCheckoutRequest_whenConfigError_forwardsErrorToListener() =
411+
runTest(testDispatcher) {
411412
val payPalInternalClient = MockkPayPalInternalClientBuilder().build()
412413

413414
val errorMessage = "Error fetching auth"

PayPalMessaging/src/test/java/com/braintreepayments/api/paypalmessaging/PayPalMessagingViewUnitTest.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ class PayPalMessagingViewUnitTest {
3838
}
3939

4040
@Test
41-
fun `test start with configuration error calls onPayPalMessagingFailure delegate with error`() = runTest(testDispatcher) {
41+
fun `test start with configuration error calls onPayPalMessagingFailure delegate with error`() =
42+
runTest(testDispatcher) {
4243
val configError = IOException("Configuration error.")
4344
val braintreeClient = MockkBraintreeClientBuilder()
4445
.configurationError(configError)
@@ -57,7 +58,8 @@ class PayPalMessagingViewUnitTest {
5758
}
5859

5960
@Test
60-
fun `test start with no client ID calls onPayPalMessagingFailure delegate with error and sends analytics`() = runTest(testDispatcher) {
61+
fun `test start with no client ID calls onPayPalMessagingFailure delegate with error and sends analytics`() =
62+
runTest(testDispatcher) {
6163
val payPalMissingClientIdConfig: Configuration = fromJson(Fixtures.CONFIGURATION_WITH_LIVE_PAYPAL_NO_CLIENT_ID)
6264
val braintreeClient = MockkBraintreeClientBuilder()
6365
.configurationSuccess(payPalMissingClientIdConfig)
@@ -78,7 +80,8 @@ class PayPalMessagingViewUnitTest {
7880
}
7981

8082
@Test
81-
fun `test start with valid configuration calls onPayPalMessagingLoading delegate and sends analytics`() = runTest(testDispatcher) {
83+
fun `test start with valid configuration calls onPayPalMessagingLoading delegate and sends analytics`() =
84+
runTest(testDispatcher) {
8285
val payPalConfiguration: Configuration = fromJson(Fixtures.CONFIGURATION_WITH_LIVE_PAYPAL)
8386
mockkObject(PayPalMessageConfig)
8487
val braintreeClient = MockkBraintreeClientBuilder()
@@ -105,7 +108,8 @@ class PayPalMessagingViewUnitTest {
105108
}
106109

107110
@Test
108-
fun `test start with valid configuration multiple times does not increase number of subviews`() = runTest(testDispatcher) {
111+
fun `test start with valid configuration multiple times does not increase number of subviews`() =
112+
runTest(testDispatcher) {
109113
val payPalConfiguration: Configuration = fromJson(Fixtures.CONFIGURATION_WITH_LIVE_PAYPAL)
110114
mockkObject(PayPalMessageConfig)
111115
val braintreeClient = MockkBraintreeClientBuilder()

Venmo/src/test/java/com/braintreepayments/api/venmo/VenmoClientUnitTest.kt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ class VenmoClientUnitTest {
167167
}
168168

169169
@Test
170-
fun createPaymentAuthRequest_whenCreatePaymentContextFails_collectAddressWithEcdDisabled() = runTest(testDispatcher) {
170+
fun createPaymentAuthRequest_whenCreatePaymentContextFails_collectAddressWithEcdDisabled() =
171+
runTest(testDispatcher) {
171172
val errorDesc = "Cannot collect customer data when ECD is disabled. Enable this feature " +
172173
"in the Control Panel to collect this data."
173174

@@ -232,8 +233,10 @@ class VenmoClientUnitTest {
232233
)
233234
}
234235

236+
@Suppress("LongMethod")
235237
@Test
236-
fun createPaymentAuthRequest_withDeepLink_whenCreatePaymentContextSucceeds_createsVenmoAuthChallenge() = runTest(testDispatcher) {
238+
fun createPaymentAuthRequest_withDeepLink_whenCreatePaymentContextSucceeds_createsVenmoAuthChallenge() =
239+
runTest(testDispatcher) {
237240
val braintreeClient = MockkBraintreeClientBuilder()
238241
.configurationSuccess(venmoEnabledConfiguration)
239242
.returnUrlScheme("com.example")
@@ -539,7 +542,8 @@ class VenmoClientUnitTest {
539542
}
540543

541544
@Test
542-
fun createPaymentAuthRequest_whenProfileIdIsSpecified_appSwitchesWithProfileIdAndAccessToken() = runTest(testDispatcher) {
545+
fun createPaymentAuthRequest_whenProfileIdIsSpecified_appSwitchesWithProfileIdAndAccessToken() =
546+
runTest(testDispatcher) {
543547
val braintreeClient = MockkBraintreeClientBuilder()
544548
.configurationSuccess(venmoEnabledConfiguration)
545549
.build()
@@ -699,7 +703,8 @@ class VenmoClientUnitTest {
699703
}
700704

701705
@Test
702-
fun createPaymentAuthRequest_whenVenmoApiError_forwardsErrorToListener_andSendsAnalytics() = runTest(testDispatcher) {
706+
fun createPaymentAuthRequest_whenVenmoApiError_forwardsErrorToListener_andSendsAnalytics() =
707+
runTest(testDispatcher) {
703708
val graphQLError = BraintreeException("GraphQL error")
704709
val braintreeClient = MockkBraintreeClientBuilder()
705710
.configurationSuccess(venmoEnabledConfiguration)
@@ -1047,7 +1052,8 @@ class VenmoClientUnitTest {
10471052
}
10481053

10491054
@Test
1050-
fun createPaymentAuthRequest_withRiskCorrelationId_passesRiskCorrelationIdToCreatePaymentContext() = runTest(testDispatcher) {
1055+
fun createPaymentAuthRequest_withRiskCorrelationId_passesRiskCorrelationIdToCreatePaymentContext() =
1056+
runTest(testDispatcher) {
10511057
val braintreeClient = MockkBraintreeClientBuilder()
10521058
.configurationSuccess(venmoEnabledConfiguration)
10531059
.build()

0 commit comments

Comments
 (0)