Skip to content
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

Robolectric 'application: Application!' is deprecated. Deprecated in Java #4671

Closed
madhurgupta10 opened this issue Oct 11, 2021 · 17 comments · Fixed by #5140
Closed

Robolectric 'application: Application!' is deprecated. Deprecated in Java #4671

madhurgupta10 opened this issue Oct 11, 2021 · 17 comments · Fixed by #5140

Comments

@madhurgupta10
Copy link
Collaborator

Summary:
'application: Application!' is deprecated. Deprecated in Java so we should use ApplicationProvider.getApplicationContext() in All Robolectric Unit Tests

Link for help: https://stackoverflow.com/questions/52883747/robolectric-runtimeenvironment-application-is-deprecated-where-is-applicationpr

Would you like to work on the issue?
No

@bernabesc
Copy link

Could you assign me this one?

@madhurgupta10
Copy link
Collaborator Author

@bernabesc Sure, thanks :)

@Asgardian8740
Copy link

Hi,
Is this issue open?
Can i work on this?

@madhurgupta10
Copy link
Collaborator Author

@Asgardian8740 Thanks for your interest, currently this issue is already assigned. You can look for other open issues in the meantime :)

@bernabesc Can you confirm if you are still working on this issue?

@bernabesc
Copy link

If he has time go ahead and assign it to him, got stuck on another fix. Sorry for the inconvenience

@madhurgupta10
Copy link
Collaborator Author

No worries, thanks for the prompt reply @bernabesc

@Asgardian8740 you can pick this up if you like :)

@glitched-sudhanshu
Copy link

@madhurgupta10 @Asgardian8740 is this issue solved now?
Or can I look into this?

@madhurgupta10
Copy link
Collaborator Author

@glitched-sudhanshu Feel free to pick up this issue :)

@glitched-sudhanshu
Copy link

@madhurgupta10 I will surely have a look at it.

@bhavanagarlapati
Copy link

Hi @nicolas-raoul Can I take this up?

@nicolas-raoul
Copy link
Member

@glitched-sudhanshu Any progress on this? :-)

@bhavanagarlapati Please take one issue at a time. Do not hesitate to come back to this one after sending a pull request for your currently assigned one. :-)

@RitikaPahwa4444
Copy link
Collaborator

RitikaPahwa4444 commented Feb 1, 2023

Hi @nicolas-raoul, is there any update on this issue? Can I take it up if it is still available?

@nicolas-raoul
Copy link
Member

@RitikaPahwa4444 It is yours, please let us know about your progress every few days, thanks! :-)

@RitikaPahwa4444
Copy link
Collaborator

Thank you @nicolas-raoul. I'll surely update my progress regularly :)

@RitikaPahwa4444
Copy link
Collaborator

RitikaPahwa4444 commented Feb 1, 2023

Update: I have changed the deprecated RuntimeEnvironment.application to ApplicationProvider.getApplicationContext() in all the Robolectric test cases and optimised the imports accordingly. All the unit tests are showing "Passed" in Android Studio on running. I have pushed my changes here:
https://github.com/RitikaPahwa4444/apps-android-commons/tree/issue-4671_robolectric_application_deprecated
@madhurgupta10 could you please have a look and confirm if any other changes are required?

@nicolas-raoul
Copy link
Member

@RitikaPahwa4444 I have not checked but would you mind sending a pull request? It is easier to comment on :-)
Thanks!

@RitikaPahwa4444
Copy link
Collaborator

I just wanted to reiterate the steps I had taken to confirm the requirements and update you about my progress here. I have created a pull request now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants