Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

Erro ao rodar o teste

Esta gerando erro, já verifiquei o Java na minha máquina, tbm verifiquei se as classes estão publicas

Nas configurações do SDK Platforms esta: Android 8.0 (Oreo)

Nas configurações do SDK tools esta: 27.0.3

Na minha máquina:

luciano@lls:~$ javac -version
javac 1.8.0_292
luciano@lls:~$ java -version
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-8u292-b10-0ubuntu1-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
luciano@lls:~$ 

org.mockito.exceptions.base.MockitoException: 
Mockito cannot mock this class: class br.com.alura.leilao.ui.recyclerview.adapter.ListaLeilaoAdapter.

Mockito can only mock non-private & non-final classes.
If you're not sure why you're getting this error, please report to the mailing list.


Java               : 11
JVM vendor name    : JetBrains s.r.o
JVM vendor version : 11.0.8+0-b944-6842174
JVM name           : OpenJDK 64-Bit Server VM
JVM version        : 11.0.8+0-b944-P17168821
JVM info           : mixed mode
OS name            : Linux
OS version         : 5.11.0-17-generic


Underlying exception : java.lang.UnsupportedOperationException: Cannot define class using reflection

    at br.com.alura.leilao.ui.recyclerview.adapter.ListaLeilaoAdapterTest.deve_AtualizarListaDeLeiloes_QuandoReceberListaDeLeiloes(ListaLeilaoAdapterTest.java:52)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
    at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
    at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220)
    at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53)
1 resposta
solução!

Fala Luciano, de boa ?

Cara, rola mostrar pra gente como está sua classe ListaLeilaoAdapter ?

Parece que está final ou que está privada.