-
Notifications
You must be signed in to change notification settings - Fork 1.3k
LocationPickerActivity is showing MapboxConfigurationException while creating it in a test class #4820
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
Comments
Looking at the logs, I guess the problem here is that Mapbox needs an actual device to get initialised properly. There could be two possible ways to write tests for this class:
|
@madhurgupta10 I tried this earlier but the same exception occurred. |
You need to avoid |
@madhurgupta10 I think without calling |
@Ayan-10 , Now I understand the testing and start working on LocationPickerActivityTest, but same error is occured with me, |
@madhurgupta10, same error happened with me, any solution ? |
Yes, for now, you can skip onCreate and write tests for other methods |
@arinmodi Refer #4820 (comment) |
@madhurgupta10, tried but not worked... |
@madhurgupta10 That's great. Sure I will add instrumentation tests too. However, I created unit tests for the class covering as much as possible. Thanks a lot for the help. |
Description
I was trying to add tests for the LocationPickerActivity class. But getting errors while building the class. Can't find any solution for that.
What I was doing
Error
I think the exception is occurring because of using Mapview and it's asking for this
Mapbox.getInstance(Context context, String accessToken)
. But NearbyParentFragment also is using mapview in the same way, it's not giving error while inflating the layout in the test.The text was updated successfully, but these errors were encountered: