There is such a test method

import com.fittingroom.newtimezone.model.ModelAcceptNotAccept; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; import static android.support.test.espresso.matcher.ViewMatchers.assertThat; import static org.hamcrest.CoreMatchers.is; import static org.mockito.Mockito.when; @RunWith(MockitoJUnitRunner.class) public class PresenterActivityAcceptNotAcceptTest { @Mock ModelAcceptNotAccept model; @Before public void setUp() throws Exception { } @Test public void setOriginPreviewImage() throws Exception { when(model.getImageFilePath()).thenReturn("path"); String path = model.getImageFilePath(); assertThat(path, is("path")); } 

and when I run setOriginPreviewImage() I get this

enter image description here

What did you do wrong?

    1 answer 1

    In the end, everything looked as if the grad just ignored dependencies. Everything worked when I manually added the library to the project.

    https://mvnrepository.com/artifact/org.mockito/mockito-core/1.10.19