From ad0f1b37c65b9eb3aa21543ed2a7835b6272870b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BAben=20Sousa?= Date: Tue, 18 Apr 2023 01:03:23 +0200 Subject: [PATCH] Remove modifier reference --- .../test/layoutmanager/mock/ViewHolderMock.kt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/dpadrecyclerview/src/test/java/com/rubensousa/dpadrecyclerview/test/layoutmanager/mock/ViewHolderMock.kt b/dpadrecyclerview/src/test/java/com/rubensousa/dpadrecyclerview/test/layoutmanager/mock/ViewHolderMock.kt index ea97639f..bd3ae1db 100644 --- a/dpadrecyclerview/src/test/java/com/rubensousa/dpadrecyclerview/test/layoutmanager/mock/ViewHolderMock.kt +++ b/dpadrecyclerview/src/test/java/com/rubensousa/dpadrecyclerview/test/layoutmanager/mock/ViewHolderMock.kt @@ -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) { @@ -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 {