Search code examples
androidrobolectricgoogle-geocoder

ShadowGeocoder missing in Robolectric 3.0?


I am trying to create a test with Robolectric 3.0 for some code that uses android.location.Geocoder but the ShadowGeocoder that is mentioned in the API (here: http://robolectric.org/javadoc/3.0/org/robolectric/shadows/maps/ShadowGeocoder.html) doesn't seem to be present in the released package.

Also, there seems to be no shadowOf(android.location.Geocoder) neither in the documentation nor in the package.

Am I doing something wrong or has anybody else run into similar problems?


Solution

  • Add this line to your build.gradle:

    dependencies {
        ...
        testCompile 'org.robolectric:shadows-maps:3.0'
        ...
    }