Skip to content

Commit

Permalink
Revert "Put test for RTN16f back (looks like accidental remove in the…
Browse files Browse the repository at this point in the history
… original PR due to RTN16f spec change is depicted red in https://github.com/ably/specification/pull/88/files)."

This reverts commit 12ea2c9.
  • Loading branch information
maratal committed Oct 15, 2023
1 parent fc9b9bd commit ca90e46
Showing 1 changed file with 0 additions and 48 deletions.
48 changes: 0 additions & 48 deletions Test/Tests/RealtimeClientConnectionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3250,54 +3250,6 @@ class RealtimeClientConnectionTests: XCTestCase {
}
}

// RTN16f
func test__085__Connection__Connection_recovery__should_use_msgSerial_from_recoveryKey_to_set_the_client_internal_msgSerial_but_is_not_sent_to_Ably() throws {
let test = Test()
let options = try AblyTests.commonAppSetup(for: test)
options.autoConnect = false
options.recover = "{\"msgSerial\":7,\"connectionKey\":\"99999!xxxxxx-xxxxxxxxx-xxxxxxxxx\",\"channelSerials\":{}}"

let testEnvironment = AblyTests.newRealtime(options)
let client = testEnvironment.client
defer { client.dispose(); client.close() }

var urlConnections = [URL]()
testEnvironment.transportFactory.networkConnectEvent = { transport, url in
if client.internal.transport !== transport {
return
}
urlConnections.append(url)
if urlConnections.count == 1 {
testEnvironment.transportFactory.networkConnectEvent = nil
}
}

waitUntil(timeout: testTimeout) { done in
client.connection.once(.connected) { stateChange in
guard let reason = stateChange.reason else {
fail("Reason is empty"); done(); return
}

XCTAssertEqual(urlConnections.count, 1)
guard let urlConnectionQuery = urlConnections.first?.query else {
fail("Missing URL Connection query"); done(); return
}

expect(urlConnectionQuery).to(haveParam("recover", withValue: "99999!xxxxxx-xxxxxxxxx-xxxxxxxxx"))
expect(urlConnectionQuery).toNot(haveParam("msgSerial"))

// recover fails, the counter should be reset to 0
XCTAssertEqual(client.internal.msgSerial, 0)

expect(reason.message).to(contain("Invalid connection key"))
XCTAssertTrue(client.connection.errorReason === reason)
done()
}
client.connect()
XCTAssertEqual(client.internal.msgSerial, 7)
}
}

// RTN16g
func test__110__Connection__Connection_recovery__connection_recovery_key_is_correctly_constructed_from_defined_parts() throws {
let test = Test()
Expand Down

0 comments on commit ca90e46

Please sign in to comment.