Skip to content

Commit 8eb497b

Browse files
committed
Update gradle and fix test
1 parent de45c12 commit 8eb497b

5 files changed

Lines changed: 8 additions & 31 deletions

File tree

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,5 @@ allprojects {
6262
}
6363

6464
task wrapper(type: Wrapper) {
65-
gradleVersion = '3.5'
65+
gradleVersion = '4.0'
6666
}

gradle/wrapper/gradle-wrapper.jar

571 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 Apr 16 12:32:19 CEST 2017
1+
#Fri Jun 16 15:36:54 CEST 2017
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-3.5-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-bin.zip

library/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
apply plugin: 'idea'
2-
31
apply plugin: 'java-library'
42
apply plugin: 'maven-publish'
53
apply plugin: 'de.fuerstenau.buildconfig'
64

75
apply plugin: "jacoco"
86
apply plugin: "io.freefair.javadoc-links"
97

8+
apply plugin: 'idea'
9+
1010
dependencies {
1111
api deps.jetbrainsAnnotations
1212

library/src/test/java/me/proxer/library/api/ProxerCallTest.java

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ public void testIOError() throws IOException {
3636
server.enqueue(new MockResponse().setBody(fromResource("news.json")).setResponseCode(404));
3737

3838
assertThatExceptionOfType(ProxerException.class).isThrownBy(() -> api.notifications().news().build().execute())
39-
.has(new Condition<Throwable>(e -> ((ProxerException) e).getErrorType() == ErrorType.IO,
40-
"IO ErrorType"));
39+
.has(new Condition<Throwable>(e -> ((ProxerException) e).getErrorType() == ErrorType.IO, "IO ErrorType"));
4140
}
4241

4342
@Test
@@ -58,26 +57,6 @@ public void testInvalidDataError() throws IOException {
5857
"PARSING ErrorType"));
5958
}
6059

61-
@Test(timeout = 1000L)
62-
public void testCancelledError() throws IOException, InterruptedException {
63-
final CountDownLatch lock = new CountDownLatch(1);
64-
65-
server.enqueue(new MockResponse().setBody(fromResource("news.json")));
66-
67-
final ProxerCall<List<NewsArticle>> call = api.notifications().news().build();
68-
69-
call.enqueue(result -> {
70-
// Failed. The lock will never be counted down and timeout.
71-
}, exception -> {
72-
assertThat(exception.getErrorType()).isEqualTo(ErrorType.CANCELLED);
73-
74-
lock.countDown();
75-
});
76-
77-
call.cancel();
78-
lock.await();
79-
}
80-
8160
@Test
8261
public void testServerError() throws Exception {
8362
server.enqueue(new MockResponse().setBody(fromResource("conferences_error.json")));
@@ -147,11 +126,9 @@ public void testCancel() throws IOException, InterruptedException {
147126
call.enqueue(result -> {
148127
// Failed. The lock will never be counted down and timeout.
149128
}, exception -> {
150-
if (exception.getErrorType() == ErrorType.IO) {
151-
lock.countDown();
152-
}
129+
assertThat(exception.getErrorType()).isEqualTo(ErrorType.CANCELLED);
153130

154-
// Failed: Not the exception we want. The lock will never be counted down and timeout.
131+
lock.countDown();
155132
});
156133

157134
call.cancel();

0 commit comments

Comments
 (0)