Skip to content

Commit

Permalink
Breaking Changes - Test
Browse files Browse the repository at this point in the history
  • Loading branch information
rkodev committed Jan 31, 2019
1 parent 6ee6b4f commit 665dce7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
import java.util.Date;
import java.util.List;

import static org.mockito.ArgumentMatchers.eq;

/**
* Created by onaio on 29/08/2017.
*/
Expand Down Expand Up @@ -80,7 +82,7 @@ public void verifygetwastedcallssqlmethodonce() {
PowerMockito.when(ImmunizationLibrary.getInstance().context().commonrepository(org.mockito.ArgumentMatchers.anyString())).thenReturn(commonRepository);
VaccinatorUtils.getWasted("", "", "");
VaccinatorUtils.getWasted("", "", "", "");
Mockito.verify(commonRepository, Mockito.times(1)).rawQuery(org.mockito.ArgumentMatchers.anyString());
Mockito.verify(commonRepository, Mockito.times(1)).rawQuery(org.mockito.ArgumentMatchers.anyString(), eq(new String[]{}));
}

@Test
Expand All @@ -90,7 +92,7 @@ public void verifyGetUsedcallssqlmethodonce() {
PowerMockito.when(ImmunizationLibrary.getInstance().context()).thenReturn(context);
PowerMockito.when(ImmunizationLibrary.getInstance().context().commonrepository(org.mockito.ArgumentMatchers.anyString())).thenReturn(commonRepository);
VaccinatorUtils.getUsed("", "", "", new String[]{"", ""});
Mockito.verify(commonRepository, Mockito.times(1)).rawQuery(org.mockito.ArgumentMatchers.anyString());
Mockito.verify(commonRepository, Mockito.times(1)).rawQuery(org.mockito.ArgumentMatchers.anyString(), eq(new String[]{}));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ public SampleRepository(Context context, org.smartregister.Context openSRPContex
public void onCreate(SQLiteDatabase database) {
super.onCreate(database);
EventClientRepository.createTable(database, EventClientRepository.Table.client, EventClientRepository.client_column.values());
EventClientRepository.createTable(database, EventClientRepository.Table.address, EventClientRepository.address_column.values());
//EventClientRepository.createTable(database, EventClientRepository.Table.address, EventClientRepository.address_column.values());
EventClientRepository.createTable(database, EventClientRepository.Table.event, EventClientRepository.event_column.values());
EventClientRepository.createTable(database, EventClientRepository.Table.obs, EventClientRepository.obs_column.values());
//EventClientRepository.createTable(database, EventClientRepository.Table.obs, EventClientRepository.obs_column.values());

VaccineRepository.createTable(database);
VaccineNameRepository.createTable(database);
Expand Down Expand Up @@ -151,7 +151,7 @@ private void upgradeToVersion2(SQLiteDatabase db) {
db.execSQL(VaccineRepository.UPDATE_TABLE_ADD_OUT_OF_AREA_COL);
db.execSQL(VaccineRepository.UPDATE_TABLE_ADD_OUT_OF_AREA_COL_INDEX);

EventClientRepository.createTable(db, EventClientRepository.Table.path_reports, EventClientRepository.report_column.values());
//EventClientRepository.createTable(db, EventClientRepository.Table.path_reports, EventClientRepository.report_column.values());
db.execSQL(VaccineRepository.UPDATE_TABLE_ADD_HIA2_STATUS_COL);

IMDatabaseUtils.accessAssetsAndFillDataBaseForVaccineTypes(context, db);
Expand Down

0 comments on commit 665dce7

Please sign in to comment.