lundi 5 novembre 2018

How to mock a class calling private method?

Moderately new to Mockito testing, researched lots bout it but how do i go around when conditions are dependent on the class private functions? For example, theres more to it, but o keep it simple:

Public SomeObject someClass(){

If(privateMethod()){

      SomeObject.set("someInput");
 }
Return SomeObject;

}

Private boolean privareMethod{..}

Aucun commentaire:

Enregistrer un commentaire