forked from ringcentral/pubnub-jtools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChannelGroupParsingTest.java
More file actions
34 lines (28 loc) · 982 Bytes
/
ChannelGroupParsingTest.java
File metadata and controls
34 lines (28 loc) · 982 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.pubnub.api;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
public class ChannelGroupParsingTest {
ChannelGroup channelGroup;
@Test
public void testParseGroup() throws PubnubException {
String name = "europe";
channelGroup = new ChannelGroup(name);
assertNull(channelGroup.namespace);
assertEquals(name, channelGroup.group);
}
@Test
public void testParseNamespacedGroup() throws PubnubException {
String name = "news:europe";
channelGroup = new ChannelGroup(name);
assertEquals("news", channelGroup.namespace);
assertEquals("europe", channelGroup.group);
}
@Test
public void testParseNamespace() throws PubnubException {
String name = "news:";
channelGroup = new ChannelGroup(name);
assertEquals("news", channelGroup.namespace);
assertNull(channelGroup.group);
}
}