Enstrümantasyon testim ile @Mock notu kullanarak sorun yaşıyorum.MockitoAnnotations.initMocks çökerken mock() başarılı olur
İşte benim gradle bağımlılıkları: Bu
View mockView
@Before
public void setup() {
mockView = Mockito.mock(View.class);
...
}
çalışır
@Mock View mockView
@Before
public void setup() {
MockitoAnnotation.initMocks(this);
...
}
Bu Bununla
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
at com.google.dexmaker.mockito.DexmakerMockMaker.getInvocationHandlerAdapter(DexmakerMockMaker.java:80)
at com.google.dexmaker.mockito.DexmakerMockMaker.getHandler(DexmakerMockMaker.java:75)
...
çöküyor:
androidTestCompile 'org.mockito:mockito-core:1.10.19'
androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
İşte bir kod örneğini parçası
Burada neler olduğu hakkında herhangi bir fikri olan var mı?
Eğer yığın izlemesi kalanını sonrası misiniz? – BretC