@@ -30,32 +30,33 @@ public void testSyncSuccess() throws IOException, PubNubException, InterruptedEx
3030 stubFor (get (urlPathEqualTo ("/v1/channel-registration/sub-key/mySubscribeKey/channel-group/groupA" ))
3131 .willReturn (aResponse ().withBody ("{\" status\" : 200, \" message\" : \" OK\" , \" payload\" : {} , \" service\" : \" ChannelGroups\" }" )));
3232
33- boolean response = partialAddChannelChannelGroup .channelGroup ("groupA" ).channels (Arrays .asList ("ch1" , "ch2" )).sync ();
34- assertThat (response , org .hamcrest .Matchers .equalTo (true ));
33+ PNChannelGroupsAddChannelResult response = partialAddChannelChannelGroup .channelGroup ("groupA" ).channels (Arrays .asList ("ch1" , "ch2" )).sync ();
34+
35+ assertNotNull (response );
36+ }
37+
38+ @ org .junit .Test (expected = PubNubException .class )
39+ public void testSyncGroupMissing () throws IOException , PubNubException , InterruptedException {
40+ stubFor (get (urlPathEqualTo ("/v1/channel-registration/sub-key/mySubscribeKey/channel-group/groupA" ))
41+ .willReturn (aResponse ().withBody ("{\" status\" : 200, \" message\" : \" OK\" , \" payload\" : {} , \" service\" : \" ChannelGroups\" }" )));
42+
43+ PNChannelGroupsAddChannelResult response = partialAddChannelChannelGroup .channels (Arrays .asList ("ch1" , "ch2" )).sync ();
3544 }
3645
37- // @org.junit.Test(expected=PubNubException.class)
38- // public void testSyncGroupMissing() throws IOException, PubNubException, InterruptedException {
39- // stubFor(get(urlPathEqualTo("/v1/channel-registration/sub-key/mySubscribeKey/channel-group/groupA"))
40- // .willReturn(aResponse().withBody("{\"status\": 200, \"message\": \"OK\", \"payload\": {} , \"service\": \"ChannelGroups\"}")));
41- //
42- // boolean response = partialAddChannelChannelGroup.channels(Arrays.asList("ch1", "ch2")).sync();
43- // }
44- //
45- // @org.junit.Test(expected=PubNubException.class)
46- // public void testSyncGroupIsEmpty() throws IOException, PubNubException, InterruptedException {
47- // stubFor(get(urlPathEqualTo("/v1/channel-registration/sub-key/mySubscribeKey/channel-group/groupA"))
48- // .willReturn(aResponse().withBody("{\"status\": 200, \"message\": \"OK\", \"payload\": {} , \"service\": \"ChannelGroups\"}")));
49- //
50- // boolean response = partialAddChannelChannelGroup.channelGroup("").channels(Arrays.asList("ch1", "ch2")).sync();
51- // }
52- //
53- // @org.junit.Test(expected=PubNubException.class)
54- // public void testSyncChannelMissing() throws IOException, PubNubException, InterruptedException {
55- // stubFor(get(urlPathEqualTo("/v1/channel-registration/sub-key/mySubscribeKey/channel-group/groupA"))
56- // .willReturn(aResponse().withBody("{\"status\": 200, \"message\": \"OK\", \"payload\": {} , \"service\": \"ChannelGroups\"}")));
57- //
58- // boolean response = partialAddChannelChannelGroup.channelGroup("groupA").sync();
59- // }
46+ @ org .junit .Test (expected = PubNubException .class )
47+ public void testSyncGroupIsEmpty () throws IOException , PubNubException , InterruptedException {
48+ stubFor (get (urlPathEqualTo ("/v1/channel-registration/sub-key/mySubscribeKey/channel-group/groupA" ))
49+ .willReturn (aResponse ().withBody ("{\" status\" : 200, \" message\" : \" OK\" , \" payload\" : {} , \" service\" : \" ChannelGroups\" }" )));
50+
51+ PNChannelGroupsAddChannelResult response = partialAddChannelChannelGroup .channelGroup ("" ).channels (Arrays .asList ("ch1" , "ch2" )).sync ();
52+ }
53+
54+ @ org .junit .Test (expected = PubNubException .class )
55+ public void testSyncChannelMissing () throws IOException , PubNubException , InterruptedException {
56+ stubFor (get (urlPathEqualTo ("/v1/channel-registration/sub-key/mySubscribeKey/channel-group/groupA" ))
57+ .willReturn (aResponse ().withBody ("{\" status\" : 200, \" message\" : \" OK\" , \" payload\" : {} , \" service\" : \" ChannelGroups\" }" )));
58+
59+ PNChannelGroupsAddChannelResult response = partialAddChannelChannelGroup .channelGroup ("groupA" ).sync ();
60+ }
6061
6162}
0 commit comments