Skip to content

Commit

Permalink
Remove modifier reference
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensousa committed Apr 17, 2023
1 parent f542c66 commit ad0f1b3
Showing 1 changed file with 0 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import androidx.recyclerview.widget.RecyclerView
import com.rubensousa.dpadrecyclerview.layoutmanager.DpadLayoutParams
import io.mockk.every
import io.mockk.mockk
import java.lang.reflect.Field
import java.lang.reflect.Modifier

class ViewHolderMock(itemView: View) {

Expand All @@ -31,9 +29,6 @@ class ViewHolderMock(itemView: View) {
init {
val itemViewField = mock::class.java.getField("itemView")
itemViewField.isAccessible = true
val modifiersField = Field::class.java.getDeclaredField("modifiers")
modifiersField.isAccessible = true
modifiersField.setInt(itemViewField, itemViewField.modifiers and Modifier.FINAL.inv())
itemViewField.set(mock, itemView)

every { mock.layoutPosition }.answers {
Expand Down

0 comments on commit ad0f1b3

Please sign in to comment.