mercredi 20 novembre 2019

Junit skip call to a function into another question

I want to test a function in my code. This function calls another function in the same class but in my test I don't want to call it (I don't need it). Somehow, my test always goes into that inner function and makes errors. Is there any means to "skip" the call to that inner function ?

Here's an example :

void function1() { 
    if(condition == true) {
        variable1 = function2()
    }
}

Object function2() {
    //Do something
    return Object;
}

Is there a way to avoid calling function 2 ?

Thank you.

Aucun commentaire:

Enregistrer un commentaire