Hello, I teach java, there is a task to test using the Mockito.spy void method that calls other methods. It does not work out correctly. Please tell me how to do it by example)

public void menu() { do { menuPrint(); switch (choice) { case "1": choise1(); break; case "2": print(mesege2); break; } } while (!exit); private void choise1() { print(mesage); methodCall() 
  • First, your code is not compiled, you forgot the brackets. Secondly, show what happened and what the specific problem is. - talex am
  • For testing, the methods must receive parameters and return values ​​.. there must not be such that the void menu() takes the value of choice from "space" it must be an input parameter. Methods should depend only on the input parameters. Looking at the code, we can say that menuPrint(); do nothing, just like choise1(); - keekkenen 6:56 pm

0