Как высмеивать "это" класса, используя PowerMock или MockitoJAVA

Программисты JAVA общаются здесь
Anonymous
Как высмеивать "это" класса, используя PowerMock или Mockito

Сообщение Anonymous »

Класс, который я хочу издеваться: < /p>

testclass.java

public class testClass(){

public String getDescription(String input){
String value = this.getDetails(input); // i am not going to change this line, hence want to mock this.
//below this i have some complexity logic, which i would like to fix cyclomatic complexity issue
}

private String getDetails(String input){
return "More details for the "+input;
}
}
< /code>

Мои вопросы в том, как мне высмеивать "this.getDetails (input)", чтобы вернуть какую -то строку для целей тестирования? < /p>

Подробнее здесь: https://stackoverflow.com/questions/470 ... or-mockito

Вернуться в «JAVA»