-
Notifications
You must be signed in to change notification settings - Fork 22
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
added Client Migration for changing the validation status to Invalid #2109
base: master
Are you sure you want to change the base?
Changes from 9 commits
a7186bf
ef1328f
0737895
293b808
985705f
6109c03
ddcd139
b9e6f14
b6b64c0
61efb28
ca0aaa2
d81b0a7
fd56abc
e093fa0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,9 @@ public static void onUpgrade(Context context, SQLiteDatabase db, int oldVersion, | |
case 12: | ||
upgradeToVersion12(db); | ||
break; | ||
case 13: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make these changes for all the flavours
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ekigamba different flavors use different DB versions for instance ba is at version 23 chad using 15 drc using 13 and so on should i upgrade all the versions to the same value? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea, we should upgrade all the versions but to different values |
||
upgradeToVersion13(db); | ||
break; | ||
default: | ||
break; | ||
} | ||
|
@@ -165,4 +168,8 @@ private static void upgradeToVersion11(SQLiteDatabase db) { | |
private static void upgradeToVersion12(SQLiteDatabase db) { | ||
RepositoryUtils.updateNullEventIds(db); | ||
} | ||
private static void upgradeToVersion13 (SQLiteDatabase db) | ||
{ | ||
RepositoryUtils.updateClientValidateStatus(db); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.smartregister.chw.repository; | ||
|
||
import net.sqlcipher.database.SQLiteDatabase; | ||
|
||
import org.junit.Test; | ||
import org.mockito.Mockito; | ||
import org.smartregister.immunization.repository.VaccineRepository; | ||
|
||
import static org.mockito.Mockito.verify; | ||
|
||
|
||
public class ChwRepositoryFlvTest { | ||
|
||
@Test | ||
public void testOnUpgrade() { | ||
SQLiteDatabase db = Mockito.mock(SQLiteDatabase.class); | ||
ChwRepositoryFlv.onUpgrade(null, db, 1, 2); | ||
verify(db).execSQL(VaccineRepository.UPDATE_TABLE_ADD_EVENT_ID_COL); | ||
verify(db).execSQL(VaccineRepository.EVENT_ID_INDEX); | ||
verify(db).execSQL(VaccineRepository.UPDATE_TABLE_ADD_FORMSUBMISSION_ID_COL); | ||
verify(db).execSQL(VaccineRepository.FORMSUBMISSION_INDEX); | ||
verify(db).execSQL(VaccineRepository.UPDATE_TABLE_ADD_OUT_OF_AREA_COL); | ||
verify(db).execSQL(VaccineRepository.UPDATE_TABLE_ADD_OUT_OF_AREA_COL_INDEX); | ||
verify(db).execSQL(VaccineRepository.UPDATE_TABLE_ADD_HIA2_STATUS_COL); | ||
|
||
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package org.smartregister.chw.util; | ||
|
||
import android.app.Activity; | ||
import android.os.Bundle; | ||
|
||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.mockito.ArgumentMatchers; | ||
import org.mockito.Mock; | ||
import org.mockito.MockitoAnnotations; | ||
import org.smartregister.chw.anc.util.DBConstants; | ||
import org.smartregister.commonregistry.CommonPersonObjectClient; | ||
|
||
import java.util.Map; | ||
|
||
import static org.mockito.Mockito.verify; | ||
import static org.mockito.Mockito.when; | ||
|
||
public class AllClientUtilsTest { | ||
|
||
@Mock | ||
private Activity mockActivity; | ||
|
||
@Mock | ||
private CommonPersonObjectClient mockPatient; | ||
|
||
@Mock | ||
private Bundle mockBundle; | ||
|
||
@Mock | ||
private Map<String,String> map; | ||
|
||
|
||
@Before | ||
public void setup (){ | ||
MockitoAnnotations.initMocks(this); | ||
} | ||
|
||
@Test | ||
public void testGoToChildProfileAboveFiveYears() { | ||
String dobString = "15"; | ||
when(mockPatient.getColumnmaps()).thenReturn(map); | ||
when(map.get(DBConstants.KEY.DOB)).thenReturn(dobString); | ||
AllClientsUtils.goToChildProfile(mockActivity, mockPatient, mockBundle); | ||
verify(mockActivity).startActivity(ArgumentMatchers.any()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Kindly specify the specific activity called in this argument/param |
||
|
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was not pulling the unique ids from source 2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this section is under
ba
and not DRCThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no this is under DRC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes its under Ba it was originally '1' in BA (master branch) i've updated the correction