-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(DataStore): endless retry of mutation request when server respond…
…s with 401 error code (#3511) (#3512) * fix(DataStore): endless retry of mutation request when server responds with 401 error code (#3511) * fix(DataStore): endless retry of mutation request when server responds with 401 error code (#3511) * fix(DataStore): endless retry of mutation request when server responds with 401 error code (#3511) Co-authored-by: Michael Law <[email protected]> --------- Co-authored-by: Michael Law <[email protected]>
- Loading branch information
Showing
4 changed files
with
118 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...aStore/Tests/AWSDataStorePluginTests/Sync/Support/AWSAuthorizationTypeIteratorTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// | ||
// Copyright Amazon.com Inc. or its affiliates. | ||
// All Rights Reserved. | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
import XCTest | ||
import AWSPluginsCore | ||
|
||
class AWSAuthorizationTypeIteratorTests: XCTestCase { | ||
|
||
func testEmptyIterator_hasNextValue_false() throws { | ||
var iterator = AWSAuthorizationTypeIterator(withValues: []) | ||
|
||
XCTAssertFalse(iterator.hasNext) | ||
XCTAssertNil(iterator.next()) | ||
} | ||
|
||
func testOneElementIterator_hasNextValue_once() throws { | ||
var iterator = AWSAuthorizationTypeIterator(withValues: [.amazonCognitoUserPools]) | ||
|
||
XCTAssertTrue(iterator.hasNext) | ||
XCTAssertNotNil(iterator.next()) | ||
|
||
XCTAssertFalse(iterator.hasNext) | ||
} | ||
|
||
func testTwoElementsIterator_hasNextValue_twice() throws { | ||
var iterator = AWSAuthorizationTypeIterator(withValues: [.amazonCognitoUserPools, .apiKey]) | ||
|
||
XCTAssertTrue(iterator.hasNext) | ||
XCTAssertNotNil(iterator.next()) | ||
|
||
XCTAssertTrue(iterator.hasNext) | ||
XCTAssertNotNil(iterator.next()) | ||
|
||
XCTAssertFalse(iterator.hasNext) | ||
} | ||
} |