Skip to content

Commit

Permalink
tests: Don't assert connection key equality
Browse files Browse the repository at this point in the history
The format of the connection key is not public, and we reserve the right
to change it server-side as we please, the only functionality the client
expects is that providing the connection key of a previous connection
results in the new connection having the same id, so that's all we need
to test.

Signed-off-by: Lewis Marshall <[email protected]>
  • Loading branch information
lmars committed Nov 27, 2024
1 parent a81632d commit d5321df
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions ably/realtime_conn_spec_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1947,9 +1947,8 @@ func TestRealtimeConn_RTN16(t *testing.T) {
assert.NoError(t, err)

{ // RTN16f, RTN16j, RTN16d
assert.True(t, sameConnection(client.Connection.Key(), c.Connection.Key()),
assert.Equal(t, prevConnId, c.Connection.ID(),
"expected the same connection")
assert.Equal(t, prevConnId, c.Connection.ID())
assert.Nil(t, client.Connection.ErrorReason())
assert.Equal(t, prevMsgSerial, client.Connection.MsgSerial(),
"expected %d got %d", prevMsgSerial, client.Connection.MsgSerial())
Expand Down Expand Up @@ -2006,10 +2005,6 @@ func TestRealtimeConn_RTN16(t *testing.T) {
}
}

func sameConnection(a, b string) bool {
return strings.Split(a, "-")[0] == strings.Split(b, "-")[0]
}

func TestRealtimeConn_RTN23(t *testing.T) {
connDetails := ably.ConnectionDetails{
ConnectionKey: "foo",
Expand Down

0 comments on commit d5321df

Please sign in to comment.