Skip to content

Commit 2442315

Browse files
committed
[ECO-5553] Fixed channel integration test assertions for modes and params
1 parent 8c85761 commit 2442315

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

lib/src/test/java/io/ably/lib/test/realtime/RealtimeChannelTest.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public void attach_with_channel_params_channels_get() {
174174
channel.attach();
175175
(new ChannelWaiter(channel)).waitFor(ChannelState.attached);
176176
assertEquals("Verify attached state reached", ChannelState.attached, channel.state);
177-
assertEquals("Verify channel params", channel.getParams(), options.params);
177+
assertEquals("Verify channel params", options.params, channel.getParams());
178178
assertArrayEquals("Verify channel modes", new ChannelMode[] { ChannelMode.subscribe }, channel.getModes());
179179
} catch (AblyException e) {
180180
e.printStackTrace();
@@ -208,7 +208,7 @@ public void attach_with_channel_params_set_options() {
208208
channel.attach();
209209
(new ChannelWaiter(channel)).waitFor(ChannelState.attached);
210210
assertEquals("Verify attached state reached", ChannelState.attached, channel.state);
211-
assertEquals("Verify channel params", channel.getParams(), options.params);
211+
assertEquals("Verify channel params", options.params, channel.getParams());
212212
assertArrayEquals("Verify channel modes", new ChannelMode[] { ChannelMode.subscribe }, channel.getModes());
213213
} catch (AblyException e) {
214214
e.printStackTrace();
@@ -285,7 +285,10 @@ public void attach_with_channel_params_modes_and_channel_modes() {
285285
(new ChannelWaiter(channel)).waitFor(ChannelState.attached);
286286
assertEquals("Verify attached state reached", ChannelState.attached, channel.state);
287287
assertEquals("Verify channel params", channel.getParams(), options.params);
288-
assertArrayEquals("Verify channel modes", new ChannelMode[] { ChannelMode.subscribe, ChannelMode.presence }, channel.getModes());
288+
// modes in params overrides individual modes in options
289+
assertThat("Verify channel modes", Arrays.asList(channel.getModes()),
290+
Matchers.containsInAnyOrder(ChannelMode.presence, ChannelMode.subscribe));
291+
289292
} catch (AblyException e) {
290293
e.printStackTrace();
291294
fail("init0: Unexpected exception instantiating library");

0 commit comments

Comments
 (0)