Questions tagged as 'mockito'

0
answers

Java - Mockito's When () function. ThenReturn ()

@Mock RequestUtils requestUtils; @Before public void init() throws IOException, ClassNotFoundException { MockitoAnnotations.initMocks(this); HtmlPage paginaPesquisa = requestUtils.executarPOST(anyObject(),anyObject());...
asked by 29.09.2017 / 15:05
0
answers

How do I test this Spring MVC method with JUnit? [closed]

Hello, I need help to create a JUnit test class for the Spring method below. @Controller public class ControllerFuncionario { @RequestMapping("/index") public String index(Funcionario funcionario, Project pro, Model model) {...
asked by 24.12.2018 / 13:37
0
answers

Pass Mock in parameter

I need to set a class, and put a face on it called "SimulationDeSet", and make the "SimulationDeSet" return the value I want, but when trying to pass this mock as a parameter it is wrong, I saw many ways to do mock but that's how I need it in th...
asked by 03.04.2018 / 21:25
0
answers

Android does not recognize Mockito NoClassDefFoundError

I'm trying to use Mockito to run tests on an Android app. I copied the following jars for the project: Mockito-all-1.9.5.jar, dexmaker-1.0.jar, dexmaker-Mockito-1.0.jar. Then I added it to BuildPath. It does not generate compile error, but when...
asked by 16.08.2015 / 23:30
1
answer

How to mock a private function in JUnit

I have a main class Usuario that extends ( extends ) an abstract class called Sessao , and uses a function of Sessao called obterDados() that takes the session data and returns it in an object SessaoTO . I...
asked by 17.09.2018 / 17:39