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() {
|
fun testLaunchTranslate() {
|
||||||
Espresso.onView(ViewMatchers.withId(R.id.about_translate)).perform(ViewActions.click())
|
Espresso.onView(ViewMatchers.withId(R.id.about_translate)).perform(ViewActions.click())
|
||||||
Espresso.onView(ViewMatchers.withId(android.R.id.button1)).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(
|
Intents.intended(
|
||||||
CoreMatchers.allOf(
|
CoreMatchers.allOf(
|
||||||
IntentMatchers.hasAction(Intent.ACTION_VIEW),
|
IntentMatchers.hasAction(Intent.ACTION_VIEW),
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,6 @@ class CommonsApplication : MultiDexApplication() {
|
||||||
@Inject
|
@Inject
|
||||||
lateinit var customOkHttpNetworkFetcher: CustomOkHttpNetworkFetcher
|
lateinit var customOkHttpNetworkFetcher: CustomOkHttpNetworkFetcher
|
||||||
|
|
||||||
//TODO [parry] not being used anywhere, remove after checking
|
|
||||||
var languageLookUpTable: AppLanguageLookUpTable? = null
|
var languageLookUpTable: AppLanguageLookUpTable? = null
|
||||||
private set
|
private set
|
||||||
|
|
||||||
|
|
@ -385,7 +384,9 @@ class CommonsApplication : MultiDexApplication() {
|
||||||
/**
|
/**
|
||||||
* Constants End
|
* Constants End
|
||||||
*/
|
*/
|
||||||
var instance: CommonsApplication? = null
|
|
||||||
|
@JvmStatic
|
||||||
|
lateinit var instance: CommonsApplication
|
||||||
private set
|
private set
|
||||||
|
|
||||||
@JvmField
|
@JvmField
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ class ThanksClient
|
||||||
revisionId.toString(), // Rev
|
revisionId.toString(), // Rev
|
||||||
null, // Log
|
null, // Log
|
||||||
csrfTokenClient.getTokenBlocking(), // Token
|
csrfTokenClient.getTokenBlocking(), // Token
|
||||||
CommonsApplication.getInstance().userAgent, // Source
|
CommonsApplication.instance.userAgent, // Source
|
||||||
).map { mwThankPostResponse ->
|
).map { mwThankPostResponse ->
|
||||||
mwThankPostResponse.result?.success == 1
|
mwThankPostResponse.result?.success == 1
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -258,7 +258,7 @@ class DescriptionEditActivity :
|
||||||
username,
|
username,
|
||||||
)
|
)
|
||||||
|
|
||||||
val commonsApplication = CommonsApplication.getInstance()
|
val commonsApplication = CommonsApplication.instance
|
||||||
if (commonsApplication != null) {
|
if (commonsApplication != null) {
|
||||||
commonsApplication.clearApplicationData(this, logoutListener)
|
commonsApplication.clearApplicationData(this, logoutListener)
|
||||||
}
|
}
|
||||||
|
|
@ -291,7 +291,7 @@ class DescriptionEditActivity :
|
||||||
username,
|
username,
|
||||||
)
|
)
|
||||||
|
|
||||||
val commonsApplication = CommonsApplication.getInstance()
|
val commonsApplication = CommonsApplication.instance
|
||||||
if (commonsApplication != null) {
|
if (commonsApplication != null) {
|
||||||
commonsApplication.clearApplicationData(this, logoutListener)
|
commonsApplication.clearApplicationData(this, logoutListener)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ class ThanksClientTest {
|
||||||
fun setUp() {
|
fun setUp() {
|
||||||
MockitoAnnotations.openMocks(this)
|
MockitoAnnotations.openMocks(this)
|
||||||
mockedApplication = Mockito.mockStatic(CommonsApplication::class.java)
|
mockedApplication = Mockito.mockStatic(CommonsApplication::class.java)
|
||||||
`when`(CommonsApplication.getInstance()).thenReturn(commonsApplication)
|
`when`(CommonsApplication.instance).thenReturn(commonsApplication)
|
||||||
thanksClient = ThanksClient(csrfTokenClient, service)
|
thanksClient = ThanksClient(csrfTokenClient, service)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue