Skip to content

Commit 04af301

Browse files
committed
little changes
1 parent 0a92ef2 commit 04af301

2 files changed

Lines changed: 9 additions & 13 deletions

File tree

‎src/test/java/com/pubnub/api/endpoints/HistoryEndpointTest.java‎

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,14 @@ public void testSyncCountReverseStartEndSuccess() throws IOException, PubNubExce
351351

352352
PNHistoryResult response = partialHistory.channel("niceChannel").count(5).reverse(true).start(1L).end(2L).includeTimetoken(true).sync();
353353

354+
List<LoggedRequest> requests = findAll(getRequestedFor(urlMatching("/v2/history/sub-key/mySubscribeKey/channel/niceChannel.*")));
355+
Assert.assertTrue(requests.get(0).queryParameter("reverse").firstValue().equals("true"));
356+
Assert.assertTrue(Integer.valueOf(requests.get(0).queryParameter("count").firstValue()).equals(5));
357+
Assert.assertTrue(Integer.valueOf(requests.get(0).queryParameter("start").firstValue()).equals(1));
358+
Assert.assertTrue(Integer.valueOf(requests.get(0).queryParameter("end").firstValue()).equals(2));
359+
Assert.assertTrue(requests.get(0).queryParameter("include_token").firstValue().equals("true"));
360+
361+
354362
Assert.assertTrue(response.getStartTimetoken().equals(1234L));
355363
Assert.assertTrue(response.getEndTimetoken().equals(4321L));
356364

@@ -398,19 +406,6 @@ public void testSyncProcessMessageError() throws IOException, PubNubException {
398406

399407
pubnub.getConfiguration().setCipherKey("Test");
400408
PNHistoryResult response = partialHistory.channel("niceChannel").count(5).reverse(true).start(1L).end(2L).includeTimetoken(true).sync();
401-
402-
Assert.assertTrue(response.getStartTimetoken().equals(1234L));
403-
Assert.assertTrue(response.getEndTimetoken().equals(4321L));
404-
405-
Assert.assertEquals(response.getMessages().size(), 2);
406-
407-
Assert.assertTrue(response.getMessages().get(0).getTimetoken().equals(1111L));
408-
Assert.assertEquals((response.getMessages().get(0).getEntry()).get("a").asInt(), 11);
409-
Assert.assertEquals((response.getMessages().get(0).getEntry()).get("b").asInt(), 22);
410-
411-
Assert.assertTrue(response.getMessages().get(1).getTimetoken().equals(2222L));
412-
Assert.assertEquals((response.getMessages().get(1).getEntry()).get("a").asInt(), 33);
413-
Assert.assertEquals((response.getMessages().get(1).getEntry()).get("b").asInt(), 44);
414409
}
415410

416411

‎src/test/java/com/pubnub/api/endpoints/TimeEndpointTest.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.pubnub.api.PubNubException;
99
import com.pubnub.api.models.consumer.PNStatus;
1010
import com.pubnub.api.models.consumer.PNTimeResult;
11+
import org.junit.Assert;
1112
import org.junit.Before;
1213
import org.junit.Rule;
1314

0 commit comments

Comments
 (0)