I just finished a development in Java 8 that i was working on, so now i need to make some unit tests with Mockito and JUnit, i already could make some of them with no problems but i just reached to a part of my code where i need to test a private method (imprimeDocumento) that is being called inside a public method (generarArchivoProd).
i read something about reflection to test private methods but i cannot understand that approach completely.
Could you help me to get an idea on how to achieve this?
My code looks like this:
//PUBLIC METHOD
public void generarArchivoProd(int anio, int mes, int dia, String paginacion){
if("1".equals(paginacion){
do this....
}
else{
do this instead....
}
//PRIVATE METHOD CALLING
this.imprimeDocumento(Long.value("0"),"",mes,anio,dia, paginacion);
}
//PRIVATE METHOD
private void imprimeDocumento(Long, int, int, int, String){
...............
}
Thanks in advance for your help