Skip to content

Commit 6d10ee3

Browse files
author
Max Presman
committed
upgrade gradle
1 parent 4b08f0f commit 6d10ee3

29 files changed

Lines changed: 165 additions & 194 deletions

‎gradle/wrapper/gradle-wrapper.jar‎

-821 Bytes
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Sun May 01 11:48:10 PDT 2016
1+
#Thu Sep 08 20:48:35 PDT 2016
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-bin.zip

‎gradlew‎

Lines changed: 30 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎gradlew.bat‎

Lines changed: 3 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/test/java/PubNubExceptionTest.java‎

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import com.fasterxml.jackson.databind.JsonNode;
21
import com.github.tomakehurst.wiremock.junit.WireMockRule;
32
import com.pubnub.api.PubNub;
4-
import com.pubnub.api.PubNubError;
53
import com.pubnub.api.PubNubException;
64
import com.pubnub.api.endpoints.TestHarness;
75
import com.pubnub.api.endpoints.pubsub.Publish;
@@ -28,6 +26,7 @@ public class PubNubExceptionTest extends TestHarness {
2826
public void beforeEach() throws IOException {
2927
pubnub = this.createPubNubInstance(8080);
3028
instance = pubnub.publish();
29+
wireMockRule.start();
3130
}
3231

3332
@Test
@@ -37,31 +36,12 @@ public void testPubnubError() throws PubNubException, InterruptedException {
3736
.willReturn(aResponse().withStatus(404).withBody("[1,\"Sent\",\"14598111595318003\"]")));
3837

3938
int statusCode = -1;
40-
PubNubError pubnubError = null;
41-
int pnErrorCode= - 1;
42-
int pnErroCodeExtended = -1;
43-
JsonNode pnErrorJNode = null;
44-
String pnErrorMessage = null;
45-
String pnErrorString = null;
46-
String response = null;
47-
String erroMsg = null;
48-
JsonNode jNode = null;
49-
5039

5140
try {
5241
instance.channel("coolChannel").message(new Object()).sync();
5342
}
5443
catch (PubNubException error) {
5544
statusCode = error.getStatusCode();
56-
pubnubError = error.getPubnubError();
57-
pnErrorCode = pubnubError.getErrorCode();
58-
pnErroCodeExtended = pubnubError.getErrorCodeExtended();
59-
pnErrorJNode = pubnubError.getErrorObject();
60-
pnErrorMessage = pubnubError.getMessage();
61-
pnErrorString = pubnubError.getErrorString();
62-
response = error.getResponse();
63-
erroMsg = error.getErrormsg();
64-
jNode = error.getJso();
6545
}
6646

6747
assertEquals(0, statusCode);

‎src/test/java/com/pubnub/api/Base64Test.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44
import org.junit.Assert;
55
import org.junit.Test;
66

7+
import java.nio.charset.Charset;
8+
79
public class Base64Test {
810

911

1012
@Test
1113
public void testBase64Encode(){
12-
Assert.assertEquals("YWJj", Base64.encodeToString("abc".getBytes(), 0).trim());
14+
Assert.assertEquals("YWJj", Base64.encodeToString("abc".getBytes(Charset.forName("UTF-8")), 0).trim());
1315
}
1416

1517
}

‎src/test/java/com/pubnub/api/PubNubTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public void testDecryptNull_B() throws PubNubException {
8787
}
8888

8989
@org.junit.Test
90-
public void GetVersionAndTimeStamp() throws PubNubException {
90+
public void getVersionAndTimeStamp() throws PubNubException {
9191
pubnub = new PubNub(pnConfiguration);
9292
String version = pubnub.getVersion();
9393
int timeStamp = pubnub.getTimestamp();

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
import com.pubnub.api.PubNub;
44
import com.pubnub.api.PubNubException;
5-
import com.pubnub.api.endpoints.channel_groups.RemoveChannelChannelGroup;
65
import com.pubnub.api.enums.PNOperationType;
7-
import com.pubnub.api.models.consumer.channel_group.PNChannelGroupsRemoveChannelResult;
86
import okhttp3.Request;
97
import org.junit.Assert;
108
import org.junit.Before;
@@ -14,12 +12,8 @@
1412
import retrofit2.Response;
1513

1614
import java.io.IOException;
17-
import java.util.Arrays;
1815
import java.util.Map;
1916

20-
import static com.github.tomakehurst.wiremock.client.WireMock.*;
21-
import static org.junit.Assert.assertNotNull;
22-
2317
public class EndpointTest extends TestHarness {
2418

2519
PubNub pubnub;
@@ -86,7 +80,7 @@ public boolean isCanceled() {
8680

8781
@Override
8882
public Call<Object> clone() {
89-
return null;
83+
return this;
9084
}
9185

9286
@Override

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public void beforeEach() throws IOException {
3232
pubnub = this.createPubNubInstance(8080);
3333
RetrofitManager retrofitManager = new RetrofitManager(pubnub);
3434
partialHeartbeat = new Heartbeat(pubnub, retrofitManager.getTransactionInstance());
35+
wireMockRule.start();
3536
}
3637

3738
@org.junit.Test

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public class HistoryEndpointTest extends TestHarness {
4040
public void beforeEach() throws IOException {
4141
pubnub = this.createPubNubInstance(8080);
4242
partialHistory = pubnub.history();
43+
wireMockRule.start();
4344
}
4445

4546

@@ -124,8 +125,7 @@ public void testSyncAuthSuccess() throws PubNubException, JsonProcessingExceptio
124125
stubFor(get(urlPathEqualTo("/v2/history/sub-key/mySubscribeKey/channel/niceChannel"))
125126
.willReturn(aResponse().withBody(mapper.writeValueAsString(testArray))));
126127

127-
128-
PNHistoryResult response = partialHistory.channel("niceChannel").includeTimetoken(true).sync();
128+
partialHistory.channel("niceChannel").includeTimetoken(true).sync();
129129

130130
List<LoggedRequest> requests = findAll(getRequestedFor(urlMatching("/.*")));
131131
assertEquals("authKey", requests.get(0).queryParameter("auth").firstValue());
@@ -254,7 +254,7 @@ public void testMissinChannel() throws IOException, PubNubException {
254254
stubFor(get(urlPathEqualTo("/v2/history/sub-key/mySubscribeKey/channel/niceChannel"))
255255
.willReturn(aResponse().withBody(mapper.writeValueAsString(testArray))));
256256

257-
PNHistoryResult response = partialHistory.includeTimetoken(true).sync();
257+
partialHistory.includeTimetoken(true).sync();
258258
}
259259

260260
@org.junit.Test(expected=PubNubException.class)
@@ -288,7 +288,7 @@ public void testChannelIsEmpty() throws IOException, PubNubException {
288288
stubFor(get(urlPathEqualTo("/v2/history/sub-key/mySubscribeKey/channel/niceChannel"))
289289
.willReturn(aResponse().withBody(mapper.writeValueAsString(testArray))));
290290

291-
PNHistoryResult response = partialHistory.channel("").includeTimetoken(true).sync();
291+
partialHistory.channel("").includeTimetoken(true).sync();
292292
}
293293

294294
@org.junit.Test
@@ -424,7 +424,7 @@ public void testSyncProcessMessageError() throws IOException, PubNubException {
424424
.willReturn(aResponse().withBody(mapper.writeValueAsString(testArray))));
425425

426426
pubnub.getConfiguration().setCipherKey("Test");
427-
PNHistoryResult response = partialHistory.channel("niceChannel").count(5).reverse(true).start(1L).end(2L).includeTimetoken(true).sync();
427+
partialHistory.channel("niceChannel").count(5).reverse(true).start(1L).end(2L).includeTimetoken(true).sync();
428428
}
429429

430430

0 commit comments

Comments
 (0)