-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes 3463 replace assert with assert that #5107
Fixes 3463 replace assert with assert that #5107
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good generally, just a few minor things to improve.
@@ -47,6 +47,7 @@ dependencies { | |||
implementation 'com.karumi:dexter:5.0.0' | |||
implementation "com.jakewharton:butterknife:$BUTTERKNIFE_VERSION" | |||
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' | |||
// implementation 'com.google.firebase:firebase-firestore:24.1.2' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really needed?
//import static org.junit.Assert.assertThat; | ||
//import static org.hamcrest.Matchers.is; | ||
//import static org.hamcrest.Matchers.not; | ||
//import static org.hamcrest.Matchers.nullValue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really needed?
@@ -991,6 +995,7 @@ public void onActivityResult(final int requestCode, final int resultCode, | |||
|
|||
if (requestCode == REQUEST_CODE && resultCode == RESULT_OK) { | |||
|
|||
// assertThat(data, not(nullValue())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really needed?
|
||
defaultConfig { | ||
minSdkVersion 19 | ||
targetSdkVersion 28 | ||
targetSdkVersion 30 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really needed?
@@ -3,13 +3,16 @@ package fr.free.nrw.commons.auth | |||
import fr.free.nrw.commons.FakeContextWrapper | |||
import fr.free.nrw.commons.FakeContextWrapperWithException | |||
import fr.free.nrw.commons.TestCommonsApplication | |||
import org.junit.Assert | |||
import org.junit.Assert.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind importing only the needed classes, explicitly?
import org.junit.Before | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
import org.robolectric.RobolectricTestRunner | ||
import org.robolectric.RuntimeEnvironment | ||
import org.robolectric.annotation.Config | ||
import org.hamcrest.CoreMatchers.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind importing only the needed classes, explicitly?
Closing this as now stale |
Description (required)
Fixes #3463
What changes did you make and why?
I replaced all instances of assert() with assertThat() where appropriate.
assertThat() error messages are easier to understand and the assertThat method has a wider range of abilities to determine if the output of a function is appropriate. For example assertThat will not complete compiling instead of failing if the expected input is an integer instead of a string.
Tests performed (required)
Tested AccountUtilUnitTest with Pixel 2 API 30