From 578de5ec74299d99b7f542d1f97423d2cf0aa60b Mon Sep 17 00:00:00 2001 From: saibotk Date: Tue, 17 Mar 2020 03:00:36 +0100 Subject: [PATCH] Update dependencies | Use Gradle 6 | Adjust exception test Exception test is now reliable and won't fail due to a previous test run, as it may occur, that the response is already null if the exception was thrown while requesting the data for the first user. --- build.gradle | 16 +++++++++++----- gradle/wrapper/gradle-wrapper.properties | 2 +- .../java/de/saibotk/jmaw/PlayerProfileTest.java | 3 +-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index e71a270..eb8c2df 100644 --- a/build.gradle +++ b/build.gradle @@ -11,13 +11,19 @@ repositories { dependencies { // This dependency is used internally, and not exposed to consumers on their own compile classpath. - implementation 'com.google.code.gson:gson:2.8.5' - implementation 'com.squareup.retrofit2:retrofit:2.5.0' - implementation 'com.squareup.retrofit2:converter-gson:2.5.0' + implementation 'com.google.code.gson:gson:2.8.6' + implementation 'com.squareup.retrofit2:retrofit:2.7.1' + implementation 'com.squareup.retrofit2:converter-gson:2.7.1' // Use JUnit test framework - testImplementation 'junit:junit:4.12' - testImplementation 'com.squareup.okhttp3:mockwebserver:3.9.1' + testImplementation 'junit:junit:4.13' + testImplementation 'com.squareup.okhttp3:mockwebserver:4.4.0' +} + +test { + testLogging { + exceptionFormat = 'full' + } } task copyJavaDocFolder(type: Copy, group: 'help') { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b3a2247..e89fcbc 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.2-all.zip diff --git a/src/test/java/de/saibotk/jmaw/PlayerProfileTest.java b/src/test/java/de/saibotk/jmaw/PlayerProfileTest.java index 637a96b..78e2fd5 100644 --- a/src/test/java/de/saibotk/jmaw/PlayerProfileTest.java +++ b/src/test/java/de/saibotk/jmaw/PlayerProfileTest.java @@ -215,13 +215,12 @@ public void testPlayerProfileResponseOnError() throws ApiResponseException { PlayerProfile pp1 = null; PlayerProfile pp2 = null; try { - pp1 = classUnderTest.getPlayerProfile("4566e69fc90748ee8d71d7ba5aa00d20").orElse(null); + classUnderTest.getPlayerProfile("4566e69fc90748ee8d71d7ba5aa00d20").orElse(null); pp2 = classUnderTest.getPlayerProfile("4566e69fc90748ee8d71d7ba5aa00d20").orElse(null); } catch (ApiResponseException e) { assertTrue(e instanceof TooManyRequestsException); } - assertNotNull(pp1); assertNull(pp2); }