HaloMigration2 extends HaloDatabaseMigration { @Override public void updateDatabase(@NonNull SQLiteDatabase database) { Create.table(HaloManagerContract.RemoteModules.class).on(database, "Create module table"); }  @Override void updateDatabase(@NonNull SQLiteDatabase database); @Override int getDatabaseVersion(); static final int VERSION; }
@Test public void thatEnsureCreateTables() { SQLiteDatabase database = mock(SQLiteDatabase.class); final int[] numOps = {0}; doAnswer(new Answer() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { numOps[0]++; return null; } }).when(database).execSQL(any(String.class)); mMigration.updateDatabase(database); assertThat(numOps[0]).isEqualTo(1); }