Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
Expand Up @@ -2,6 +2,7 @@

package com.apple.itunes.storekit.model;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

Expand Down Expand Up @@ -87,7 +88,7 @@ public static <T> List<T> validateItems(List<T> list) {
}
}

return list;
return new ArrayList<>(list);
}

private static String validateStringWithMaxLength(String value, int maxLength, String fieldName) {
Expand All @@ -97,4 +98,4 @@ private static String validateStringWithMaxLength(String value, int maxLength, S
}
return value;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1163,8 +1163,9 @@ public void testAdvancedCommerceSubscriptionReactivateInAppRequestItemsValidatio

@Test
public void testAdvancedCommerceRequestAddItemAppendsToList() {
AdvancedCommerceSubscriptionPriceChangeRequest priceChangeRequest = new AdvancedCommerceSubscriptionPriceChangeRequest(createRequestInfo(), new ArrayList<>(List.of(new AdvancedCommerceSubscriptionPriceChangeItem("sku", 1000L))))
AdvancedCommerceSubscriptionPriceChangeRequest priceChangeRequest = new AdvancedCommerceSubscriptionPriceChangeRequest(createRequestInfo(), List.of(new AdvancedCommerceSubscriptionPriceChangeItem("sku", 1000L)))
.addItem(new AdvancedCommerceSubscriptionPriceChangeItem("sku2", 2000L));

Assertions.assertEquals(List.of(new AdvancedCommerceSubscriptionPriceChangeItem("sku", 1000L), new AdvancedCommerceSubscriptionPriceChangeItem("sku2", 2000L)), priceChangeRequest.getItems());

AdvancedCommerceSubscriptionCreateRequest createRequest = new AdvancedCommerceSubscriptionCreateRequest(createRequestInfo(), "USD", new AdvancedCommerceDescriptors("description", "display name"), new ArrayList<>(List.of(new AdvancedCommerceSubscriptionCreateItem("sku", "description", "display name", 1000L))),
Expand Down