Skip navigation links

Package org.robolectric.pluginapi

Extension points for customizing Robolectric.

See: Description

Package org.robolectric.pluginapi Description

Extension points for customizing Robolectric.

Robolectric has many components which can be customized or replaced using an extension mechanism based on Java Services.

Historically, customizing Robolectric required subclassing org.robolectric.RobolectricTestRunner to override behavior at various ad-hoc extension points. This mechanism is now deprecated. The Plugin API provides a number of well documented and supported extension points allowing you to customize behavior for your organization’s needs.

The interfaces listed below can be implemented with customizations suitable for your organization. To make your custom implementation visible to Robolectric, publish it as a service and include it in the test classpath. Google’s @AutoService annotation is helpful for this.

Extension point Default Implementation
ConfigurationStrategy org.robolectric.plugins.HierarchicalConfigurationStrategy
DependencyResolver org.robolectric.LegacyDependencyResolver
GlobalConfigProvider none
PerfStatsReporter none
SdkPicker org.robolectric.plugins.DefaultSdkPicker
SdkProvider org.robolectric.plugins.DefaultSdkProvider
Skip navigation links