mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-11-02 15:53:55 +01:00
instance property access fix
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
This commit is contained in:
parent
8d629b4305
commit
f26b651f54
5 changed files with 8 additions and 7 deletions
|
|
@ -105,7 +105,7 @@ class AboutActivityTest {
|
|||
fun testLaunchTranslate() {
|
||||
Espresso.onView(ViewMatchers.withId(R.id.about_translate)).perform(ViewActions.click())
|
||||
Espresso.onView(ViewMatchers.withId(android.R.id.button1)).perform(ViewActions.click())
|
||||
val langCode = CommonsApplication.getInstance().languageLookUpTable.codes[0]
|
||||
val langCode = CommonsApplication.instance.languageLookUpTable!!.codes[0]
|
||||
Intents.intended(
|
||||
CoreMatchers.allOf(
|
||||
IntentMatchers.hasAction(Intent.ACTION_VIEW),
|
||||
|
|
|
|||
|
|
@ -85,7 +85,6 @@ class CommonsApplication : MultiDexApplication() {
|
|||
@Inject
|
||||
lateinit var customOkHttpNetworkFetcher: CustomOkHttpNetworkFetcher
|
||||
|
||||
//TODO [parry] not being used anywhere, remove after checking
|
||||
var languageLookUpTable: AppLanguageLookUpTable? = null
|
||||
private set
|
||||
|
||||
|
|
@ -385,7 +384,9 @@ class CommonsApplication : MultiDexApplication() {
|
|||
/**
|
||||
* Constants End
|
||||
*/
|
||||
var instance: CommonsApplication? = null
|
||||
|
||||
@JvmStatic
|
||||
lateinit var instance: CommonsApplication
|
||||
private set
|
||||
|
||||
@JvmField
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class ThanksClient
|
|||
revisionId.toString(), // Rev
|
||||
null, // Log
|
||||
csrfTokenClient.getTokenBlocking(), // Token
|
||||
CommonsApplication.getInstance().userAgent, // Source
|
||||
CommonsApplication.instance.userAgent, // Source
|
||||
).map { mwThankPostResponse ->
|
||||
mwThankPostResponse.result?.success == 1
|
||||
}
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ class DescriptionEditActivity :
|
|||
username,
|
||||
)
|
||||
|
||||
val commonsApplication = CommonsApplication.getInstance()
|
||||
val commonsApplication = CommonsApplication.instance
|
||||
if (commonsApplication != null) {
|
||||
commonsApplication.clearApplicationData(this, logoutListener)
|
||||
}
|
||||
|
|
@ -291,7 +291,7 @@ class DescriptionEditActivity :
|
|||
username,
|
||||
)
|
||||
|
||||
val commonsApplication = CommonsApplication.getInstance()
|
||||
val commonsApplication = CommonsApplication.instance
|
||||
if (commonsApplication != null) {
|
||||
commonsApplication.clearApplicationData(this, logoutListener)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class ThanksClientTest {
|
|||
fun setUp() {
|
||||
MockitoAnnotations.openMocks(this)
|
||||
mockedApplication = Mockito.mockStatic(CommonsApplication::class.java)
|
||||
`when`(CommonsApplication.getInstance()).thenReturn(commonsApplication)
|
||||
`when`(CommonsApplication.instance).thenReturn(commonsApplication)
|
||||
thanksClient = ThanksClient(csrfTokenClient, service)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue