You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Context: Android Tests for App Lifecycle Callbacks and Checking for updates
TLDR - Can I still use MapSettings to persistent Settings like MockSettings did in previous versions or should I move to something else?
I'm moving from 0.6.2 to 1.0.0 and see that MockSettings has changed to MapSettings. I have some tests that are now failing and I'm trying to figure out how to move forward.
MockSettings used to persist the data I'm testing, i.e. app version has been updated. However, using MapSettings, I see when I go to check the app version the second time around, it's null instead of version one.
Old Flow
MockSettingsExtension beforeEach - install
AppCallbacksTest setting current app version = AppVersion(code=0, name=0, lastUpdateTime=0)
AppCallbacksTest moving to MAX
savedAppVersion update() - setting AppVersion(code=0, name=0, lastUpdateTime=0)
savedAppVersion get() - returning null
savedAppVersion. update() - first install (null) case
savedAppVersion set() - setting AppVersion(code=0, name=0, lastUpdateTime=0)
InternalAppCallbacks onCreate - wasUpgraded = false
AppCallbacksTest moving to MIN
AppCallbacksTest registering callbacks
AppCallbacksTest setting current app version = AppVersion(code=1, name=1, lastUpdateTime=0)
AppCallbacksTest moving to LAUNCHED
savedAppVersion update() - setting AppVersion(code=1, name=1, lastUpdateTime=0)
savedAppVersion get() - returning AppVersion(code=0, name=0, lastUpdateTime=0)
savedAppVersion update() - updated (-1) case
savedAppVersion get() - returning AppVersion(code=0, name=0, lastUpdateTime=0)
savedAppVersion set() - setting AppVersion(code=1, name=1, lastUpdateTime=0)
InternalAppCallbacks onCreate - wasUpgraded = true
MockSettingsExtension afterEach - reset
New Flow
MockSettingsExtension beforeEach - install
AppCallbacksTest setting current app version = AppVersion(code=0, name=0, lastUpdateTime=0)
AppCallbacksTest moving to MAX
savedAppVersion update() - setting AppVersion(code=0, name=0, lastUpdateTime=0)
savedAppVersion get() - returning null
savedAppVersion update() - first install (null) case
savedAppVersion set() - setting AppVersion(code=0, name=0, lastUpdateTime=0)
InternalAppCallbacks onCreate() - wasUpgraded = false
AppCallbacksTest moving to MIN
AppCallbacksTest registering callbacks
AppCallbacksTest setting current app version = AppVersion(code=1, name=1, lastUpdateTime=0)
AppCallbacksTest moving to LAUNCHED
savedAppVersion update() - setting AppVersion(code=1, name=1, lastUpdateTime=0)
savedAppVersion get() - returning null
savedAppVersion update() - first install (null) case
savedAppVersion set() - setting AppVersion(code=1, name=1, lastUpdateTime=0)
InternalAppCallbacks onCreate() - wasUpgraded = false
MockSettingsExtension afterEach - reset
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Context: Android Tests for App Lifecycle Callbacks and Checking for updates
TLDR - Can I still use MapSettings to persistent Settings like MockSettings did in previous versions or should I move to something else?
I'm moving from 0.6.2 to 1.0.0 and see that MockSettings has changed to MapSettings. I have some tests that are now failing and I'm trying to figure out how to move forward.
MockSettings used to persist the data I'm testing, i.e. app version has been updated. However, using MapSettings, I see when I go to check the app version the second time around, it's null instead of version one.
Old Flow
New Flow
Beta Was this translation helpful? Give feedback.
All reactions