Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.3.0+6

* Bumps org.mockito:mockito-core from 4.7.0 to 5.3.1.

## 0.3.0+5

* Bumps org.jetbrains.kotlin:kotlin-bom from 1.8.0 to 1.8.21.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ dependencies {
implementation 'com.android.billingclient:billing:5.2.0'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.json:json:20230227'
testImplementation 'org.mockito:mockito-core:4.7.0'
testImplementation 'org.mockito:mockito-core:5.3.1'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.mockito.Spy;
Expand All @@ -88,6 +89,7 @@ public class MethodCallHandlerTest {
@Mock Activity activity;
@Mock Context context;
@Mock ActivityPluginBinding mockActivityPluginBinding;
@Captor ArgumentCaptor<HashMap<String, Object>> resultCaptor;

@Before
public void setUp() {
Expand Down Expand Up @@ -240,8 +242,6 @@ public void queryProductDetailsAsync() {
.setDebugMessage("dummy debug message")
.build();
listenerCaptor.getValue().onProductDetailsResponse(billingResult, productDetailsResponse);
@SuppressWarnings("unchecked")
ArgumentCaptor<HashMap<String, Object>> resultCaptor = ArgumentCaptor.forClass(HashMap.class);
verify(result).success(resultCaptor.capture());
HashMap<String, Object> resultData = resultCaptor.getValue();
assertEquals(resultData.get("billingResult"), fromBillingResult(billingResult));
Expand Down Expand Up @@ -652,8 +652,6 @@ public void queryPurchases_returns_success() throws Exception {
public void queryPurchaseHistoryAsync() {
// Set up an established billing client and all our mocked responses
establishConnectedBillingClient(null, null);
@SuppressWarnings("unchecked")
ArgumentCaptor<HashMap<String, Object>> resultCaptor = ArgumentCaptor.forClass(HashMap.class);
BillingResult billingResult =
BillingResult.newBuilder()
.setResponseCode(100)
Expand Down Expand Up @@ -704,8 +702,6 @@ public void onPurchasesUpdatedListener() {
.setDebugMessage("dummy debug message")
.build();
List<Purchase> purchasesList = asList(buildPurchase("foo"));
@SuppressWarnings("unchecked")
ArgumentCaptor<HashMap<String, Object>> resultCaptor = ArgumentCaptor.forClass(HashMap.class);
doNothing()
.when(mockMethodChannel)
.invokeMethod(eq(ON_PURCHASES_UPDATED), resultCaptor.capture());
Expand All @@ -719,7 +715,6 @@ public void onPurchasesUpdatedListener() {
@Test
public void consumeAsync() {
establishConnectedBillingClient(null, null);
ArgumentCaptor<BillingResult> resultCaptor = ArgumentCaptor.forClass(BillingResult.class);
BillingResult billingResult =
BillingResult.newBuilder()
.setResponseCode(100)
Expand Down Expand Up @@ -749,7 +744,6 @@ public void consumeAsync() {
@Test
public void acknowledgePurchase() {
establishConnectedBillingClient(null, null);
ArgumentCaptor<BillingResult> resultCaptor = ArgumentCaptor.forClass(BillingResult.class);
BillingResult billingResult =
BillingResult.newBuilder()
.setResponseCode(100)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: in_app_purchase_android
description: An implementation for the Android platform of the Flutter `in_app_purchase` plugin. This uses the Android BillingClient APIs.
repository: https://github.com/flutter/packages/tree/main/packages/in_app_purchase/in_app_purchase_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22
version: 0.3.0+5
version: 0.3.0+6

environment:
sdk: ">=2.18.0 <4.0.0"
Expand Down