I have mock data that I want to use for both unit and instrumented test. To avoid repetition, I created a common directory testHelper and placed my mock data there. In app/build.gradle I did:
sourceSets {
androidTest {
java.srcDirs += 'testHelper'
}
test {
java.srcDirs += 'testHelper'
}
}
Now i can import my mock data from unit and UI tests but I can also access them from the main app. I want to avoid doing that. I tried a few tips such as adding src/ to the above but it made no difference.
basically, I don't want my main code to access the mock data
import AppMockData // ==> this shouldn't work. currently it does.
@Composable
fun HelloWorld(){}