@@ -753,61 +753,6 @@ class AuthTests: XCTestCase {
753
753
wait ( for: [ condition1] , timeout: testExpectationTimeoutForInverted)
754
754
}
755
755
756
- func testA( ) throws {
757
-
758
- let expectation1 = expectation ( description: #function)
759
-
760
- var callNumber = 0
761
- let authDelegate = createAuthDelegate {
762
- callNumber += 1
763
- if callNumber == 1 {
764
- return nil
765
- } else {
766
- return " some-auth-token "
767
- }
768
- }
769
-
770
- let config = IterableConfig ( )
771
- config. authDelegate = authDelegate
772
-
773
- let networkSession = MockJwtResponseNetworkSession ( )
774
-
775
- let api = InternalIterableAPI . initializeForTesting (
776
- config: config,
777
- networkSession: networkSession
778
- )
779
- api. userId = " some-user-id "
780
- api. track ( " some-event " ) . onSuccess { _ in
781
- print ( " success " )
782
- expectation1. fulfill ( )
783
- } . onError { error in
784
- print ( " error, \( error) " )
785
- expectation1. fulfill ( )
786
- }
787
- wait ( for: [ expectation1] , timeout: testExpectationTimeout)
788
-
789
- class MockJwtResponseNetworkSession : NetworkSessionProtocol {
790
- var callNumber = 0
791
- func makeRequest( _ request: URLRequest , completionHandler: @escaping CompletionHandler ) {
792
- callNumber += 1
793
- let data = callNumber == 1 ? [ JsonKey . Response . iterableCode : JsonValue . Code . invalidJwtPayload ] . toJsonData ( ) : nil
794
- let response = HTTPURLResponse ( url: request. url!,
795
- statusCode: callNumber == 1 ? 401 : 200 ,
796
- httpVersion: " HTTP/1.1 " ,
797
- headerFields: [ : ] )
798
- completionHandler ( data, response, nil )
799
- }
800
-
801
- func makeDataRequest( with url: URL , completionHandler: @escaping CompletionHandler ) {
802
- fatalError ( )
803
- }
804
-
805
- func createDataTask( with url: URL , completionHandler: @escaping CompletionHandler ) -> DataTaskProtocol {
806
- fatalError ( )
807
- }
808
- }
809
- }
810
-
811
756
// MARK: - Private
812
757
813
758
class DefaultAuthDelegate : IterableAuthDelegate {
0 commit comments