From d5321dff77944016c6069653becc0b6d7d8a6a91 Mon Sep 17 00:00:00 2001 From: Lewis Marshall Date: Wed, 27 Nov 2024 15:52:35 +0000 Subject: [PATCH] tests: Don't assert connection key equality 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 --- ably/realtime_conn_spec_integration_test.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/ably/realtime_conn_spec_integration_test.go b/ably/realtime_conn_spec_integration_test.go index eb4be2fa..40a0f65a 100644 --- a/ably/realtime_conn_spec_integration_test.go +++ b/ably/realtime_conn_spec_integration_test.go @@ -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()) @@ -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",