Instead of declaring the activity and view for every test method you can make them fields with lazy initialization instead to avoid repetition of the code
...
val activity by lazy {
activityController.setup().get()
}
val someView by lazy {
activity.find<ViewClass>("someViewId")
}
...
these fields will only be instatiated when the field is used for the first time. JUnit re-instantiates fields for every test method.
Instead of declaring the activity and view for every test method you can make them fields with lazy initialization instead to avoid repetition of the code
these fields will only be instatiated when the field is used for the first time. JUnit re-instantiates fields for every test method.