do not use internal FieldSetter

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2020-09-10 12:46:09 +02:00
parent 7f729e630e
commit eb839c3968
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7

View file

@ -28,7 +28,6 @@ import org.junit.Test;
import org.mockito.Mock; import org.mockito.Mock;
import org.mockito.Mockito; import org.mockito.Mockito;
import org.mockito.MockitoAnnotations; import org.mockito.MockitoAnnotations;
import org.mockito.internal.util.reflection.FieldSetter;
import java.util.ArrayList; import java.util.ArrayList;
@ -39,10 +38,10 @@ public final class ActivityListAdapterTest {
private ActivityListAdapter activityListAdapter; private ActivityListAdapter activityListAdapter;
@Before @Before
public void setUp() throws NoSuchFieldException { public void setUp() {
MockitoAnnotations.initMocks(this); MockitoAnnotations.initMocks(this);
MockitoAnnotations.initMocks(activityListAdapter); MockitoAnnotations.initMocks(activityListAdapter);
FieldSetter.setField(activityListAdapter, activityListAdapter.getClass().getDeclaredField("values"), new ArrayList<>()); activityListAdapter.values = new ArrayList<>();
} }
@Test @Test