diff --git a/lib/src/test/java/io/ably/lib/test/realtime/RealtimeChannelTest.java b/lib/src/test/java/io/ably/lib/test/realtime/RealtimeChannelTest.java index 8108ae6df..f58fe832f 100644 --- a/lib/src/test/java/io/ably/lib/test/realtime/RealtimeChannelTest.java +++ b/lib/src/test/java/io/ably/lib/test/realtime/RealtimeChannelTest.java @@ -1669,7 +1669,7 @@ public void channel_invalid_resume_reattach_channels() throws AblyException { ErrorInfo resumeError = connectionWaiter.waitFor(ConnectionState.connected); assertNotNull(resumeError); - assertTrue(resumeError.message.contains("Invalid connection key")); + assertEquals("Verify error code indicates invalid connection key", resumeError.code, 80018); assertSame(resumeError, ably.connection.connectionManager.getStateErrorInfo()); assertNotEquals("A new connection was created", originalConnectionId, ably.connection.id);