Is there a way to test private method which is returning a string that is getting called from a public method and the string is written in file?

Viewed 25
private String nameString(String name){
return string;
}

public void fileString(String someName){
File.write(nameString(someName).getBytes(StandartCharsets.UTF_8).StandardOpenOption.CREATE);
}

I am trying to write a test method to check whether the name is getting written in the file or not. How do I do that using Mockito?

0 Answers
Related