mockspresso-api / com.episode6.hackit.mockspresso / Mockspresso / Builder / testResources

testResources

@NotNull abstract fun testResources(@NotNull objectWithResources: Any): Mockspresso.Builder

Scans the included objectWithResources for fields annotated with @Mock and @RealObject, then prepares them and adds them to our dependency map. Will also call any methods annotated with org.junit.Before during the initialization process, and any methods annotated with org.junit.After during the teardown process. Don't pass the actual test class to this method, as it will result in multiple calls to your @Before and @After methods. Instead use #testResourcesWithoutLifecycle(Object)

Parameters

objectWithResources - Any: The object to scan, set fields on and initialize

Return
Mockspresso.Builder: this