Merge pull request #6927 from nextcloud/fixMockito

do not use internal FieldSetter
This commit is contained in:
Tobias Kaminsky 2020-09-11 10:34:43 +02:00 committed by GitHub
commit 706b47f3f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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