-
Notifications
You must be signed in to change notification settings - Fork 374
stripped issuer from label and updated unit tests #560
Conversation
app/src/main/java/org/shadowice/flocke/andotp/Database/Entry.java
Outdated
Show resolved
Hide resolved
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.
The stripping of the label is now ok, but there are still a lot of problems with the tests. I added some comments how I got them to work on my system (they didn't work with just your PR).
app/build.gradle
Outdated
@@ -67,4 +68,8 @@ dependencies { | |||
implementation "org.sufficientlysecure:openpgp-api:12.0" | |||
implementation "com.leinardi.android:speed-dial:3.1.1" | |||
implementation "com.mikepenz:aboutlibraries:6.2.3" | |||
|
|||
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.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.
This is mixing old Android support libraries with the new AndroidX libraries that are used in andOTP and fails for me. You need to use androidTestImplementation "androidx.test.espresso:espresso-core:3.2.0"
in order to make it work.
public ApplicationTest() { | ||
super(Application.class); | ||
} | ||
@RunWith(AndroidJUnit4.class) |
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.
Can be removed, along with the import
statements for AndroidJUnit4
and RunWith
.
@@ -58,12 +60,13 @@ | |||
import javax.crypto.spec.IvParameterSpec; | |||
import javax.crypto.spec.SecretKeySpec; | |||
|
|||
public class ApplicationTest extends ApplicationTestCase<Application> { | |||
import static junit.framework.TestCase.assertEquals; | |||
import static junit.framework.TestCase.assertTrue; |
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.
Use
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
instead.
import android.content.Context; | ||
import android.test.ApplicationTestCase; | ||
import androidx.test.InstrumentationRegistry; |
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.
Deprecated, use androidx.test.platform.app.InstrumentationRegistry
instead.
public void testSettingsHelper() throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException { | ||
Context context = getContext(); | ||
Context context = InstrumentationRegistry.getTargetContext(); |
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.
This is deprecated, use InstrumentationRegistry.getInstrumentation().getTargetContext();
from androidx.test.platform.app.InstrumentationRegistry
(see comment above).
Thanks @flocke |
Fix for issue #551
Issuer is now stripped from the label
Tests are updated accordingly.