@Test
public void onUpgradeFromV15() {

    final int oldVersion = 15;
    final int newVersion = DatabaseHelper.DATABASE_VERSION;
    final TableDefaultsCustomizer customizer = mock(TableDefaultsCustomizer.class);
    mCategoriesTable.onUpgrade(mSQLiteDatabase, oldVersion, newVersion, customizer);
    verify(mSQLiteDatabase, atLeastOnce()).execSQL(mSqlCaptor.capture());
    verify(customizer, never()).insertCategoryDefaults(mCategoriesTable);
    List<String> allValues = mSqlCaptor.getAllValues();
    assertEquals(5, allValues.size());
    assertEquals(allValues.get(0), "CREATE TABLE " + CategoriesTable.TABLE_NAME + "_copy" + " ("
            + COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
            + COLUMN_NAME + " TEXT, "
            + COLUMN_CODE + " TEXT, "
            + COLUMN_BREAKDOWN + " BOOLEAN DEFAULT 1, "
            + COLUMN_DRIVE_SYNC_ID + " TEXT, "
            + COLUMN_DRIVE_IS_SYNCED + " BOOLEAN DEFAULT 0, "
            + COLUMN_DRIVE_MARKED_FOR_DELETION + " BOOLEAN DEFAULT 0, "
            + COLUMN_LAST_LOCAL_MODIFICATION_TIME + " DATE, "
            + COLUMN_CUSTOM_ORDER_ID + " INTEGER DEFAULT 0"
            + ");");
    final String baseColumns = TextUtils.join(", ", new String[]{
            COLUMN_NAME, COLUMN_CODE, COLUMN_BREAKDOWN, COLUMN_DRIVE_SYNC_ID,
            COLUMN_DRIVE_IS_SYNCED, COLUMN_DRIVE_MARKED_FOR_DELETION, COLUMN_LAST_LOCAL_MODIFICATION_TIME});
    assertEquals(allValues.get(1), "INSERT INTO " + CategoriesTable.TABLE_NAME + "_copy ("
            + baseColumns + ") "
            + "SELECT " + baseColumns
            + " FROM " + CategoriesTable.TABLE_NAME + ";");
    assertEquals(allValues.get(2), "DROP TABLE " + CategoriesTable.TABLE_NAME + ";");
    assertEquals(allValues.get(3), "ALTER TABLE " + CategoriesTable.TABLE_NAME + "_copy "
            + "RENAME TO " + CategoriesTable.TABLE_NAME + ";");
    assertEquals(allValues.get(4), "ALTER TABLE " + CategoriesTable.TABLE_NAME + " ADD " + AbstractSqlTable.COLUMN_UUID + " TEXT");
}