Skip to content

Commit

Permalink
Update dependencies | Use Gradle 6 | Adjust exception test
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
saibotk committed Mar 17, 2020
1 parent aebc838 commit 578de5e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
16 changes: 11 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions src/test/java/de/saibotk/jmaw/PlayerProfileTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);

}
Expand Down

0 comments on commit 578de5e

Please sign in to comment.