mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-02 11:46:53 +00:00
Handle ACCOUNT_NOT_FOUND errors in AppleAppStoreClient
This commit is contained in:
1 parent
355b320c92
commit
f588390bdb
2 files changed
+16
-2
No files matched your search
+14
@@ -6,6 +6,7 @@ package org.whispersystems.textsecuregcm.subscriptions;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatException;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.reset;
|
||||
import static org.mockito.Mockito.times;
|
||||
@@ -63,6 +64,19 @@ class AppleAppStoreClientTest {
|
||||
verifyNoInteractions(sandboxClient);
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@EnumSource(mode = EnumSource.Mode.INCLUDE, names = {"TRANSACTION_ID_NOT_FOUND", "ORIGINAL_TRANSACTION_ID_NOT_FOUND", "ACCOUNT_NOT_FOUND"})
|
||||
public void notFound(APIError error) throws APIException, IOException {
|
||||
when(productionClient.getAllSubscriptionStatuses(ORIGINAL_TX_ID, new Status[]{}))
|
||||
.thenThrow(new APIException(404, error, "test"));
|
||||
when(sandboxClient.getAllSubscriptionStatuses(ORIGINAL_TX_ID, new Status[]{}))
|
||||
.thenThrow(new APIException(404, error, "test"));
|
||||
|
||||
assertThatExceptionOfType(SubscriptionNotFoundException.class)
|
||||
.isThrownBy(() -> apiWrapper.getAllSubscriptions(ORIGINAL_TX_ID, Tags.empty()));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void fallbackOnNoTransactionFound()
|
||||
throws APIException, IOException, SubscriptionInvalidArgumentsException, SubscriptionNotFoundException, RateLimitExceededException {
|
||||
|
||||
Reference in new issue
Block a user