title: Method getReadableDatabase in android.database.sqlite.SQLiteOpenHelper not mocked
body: <p>I'd like to test the methods inside the databasehelper class. I develop with Android studio. I use <code>Mockito</code> for testing and I got error message running the test: </p>
  
  <blockquote>
    <p>Method getReadableDatabase in android.database.sqlite.SQLiteOpenHelper not mocked.</p>
  </blockquote>
  
  <p>This is my <code>DatabaseHelper</code> class:</p>
  
  <pre><code>public class DatabaseHelper2 extends SQLiteOpenHelper {
  
      //The Android's default system path of your application database.
      private static String DB_PATH = "/data/data/com.example.b.mywm/databases/";
  
      private static String DB_NAME = "429";
  
      private SQLiteDatabase myDataBase;
  
      private final Context myContext;
  
      /**
       * Constructor
       */
      public DatabaseHelper2(Context context) {
          super(context, DB_NAME, null, 1);
          this.myContext = context;
      }
  
      public void openDataBase() throws SQLException {
          //Open the database
          String myPath = DB_PATH + DB_NAME;
          myDataBase = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);
      }
  
      @Override
      public void onCreate(SQLiteDatabase db) {
      }
  
      @Override
      public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
      }
  
      @Override
      public synchronized void close() {
          if(myDataBase != null) {
              myDataBase.close();
          }
  
          super.close();
      }
      public List&lt;Topic&gt; getTopics() {
          SQLiteDatabase db = this.getReadableDatabase();
  
          ArrayList&lt;Topic&gt; topics = new ArrayList&lt;Topic&gt;();
  
          int id = -1;
          String description = "";
  
          Cursor c = db.rawQuery("SELECT * FROM" + "Topics", null);
  
          if (c.moveToFirst()) {
              id = c.getInt(c.getColumnIndex("ID"));
              description = c.getString(c.getColumnIndex("Description"));
  
              Topic t = new Topic(id, description);
              topics.add(t);
          }
          c.close();
  
          //  Contact contact = new Contact(Integer.parseInt(cursor.getString(0)),
          //        cursor.getString(1), cursor.getString(2));
          // return contact
          return topics;
      }
  }
  </code></pre>
  
  <p>My test:</p>
  
  <pre><code>@RunWith(MockitoJUnitRunner.class)
  public class DBTest {
  
      @Mock
      Context mMockContext;
  
      @Mock
      DatabaseHelper2 dataBaseHelper;
  
      @Before
      public void setUp() {
          dataBaseHelper = new DatabaseHelper2(mMockContext);
      }
  
      @Test
      public void readStringFromContext_LocalizedString() {
         List&lt;Topic&gt; f = dataBaseHelper.getTopics();
      }
  }
  </code></pre>