Skip to content
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 androidx import, lint & powermock reflection issues #2

Merged
merged 3 commits into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private ArrayList<String> getListOfContacts() {

if (cur != null && cur.getCount() > 0) {
while (cur.moveToNext()) {
String name = cur.getString(cur.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));
String name = cur.getString(cur.getColumnIndexOrThrow(ContactsContract.Contacts.DISPLAY_NAME));
contactsList.add(name);
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/test/java/com/tumblr/permissme/PermissMeTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import androidx.core.app.Fragment;
import android.support.v7.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.appcompat.app.AppCompatActivity;
import com.tumblr.permissme.utils.PermissMeUtils;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Matchers;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

Expand All @@ -26,6 +27,7 @@
*/
@RunWith(PowerMockRunner.class)
@PrepareForTest({PermissMeUtils.class, PermissMe.class})
@PowerMockIgnore("jdk.internal.reflect.*")
public class PermissMeTests {

private PermissMe mPermissMe;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.mockito.BDDMockito;
import org.mockito.Mockito;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

Expand All @@ -27,6 +28,7 @@
@RunWith(PowerMockRunner.class)
@PrepareForTest(PermissionChecker.class)
@SuppressWarnings("ConstantConditions")
@PowerMockIgnore("jdk.internal.reflect.*")
public class PermissMeUtilsTest {

private final Context mockContext;
Expand Down