mardi 29 mars 2022

How can I access the internal variable of a method in Java junit?

I have a function in which a random number is generated as shown below

public void method(){
     int number = random();
     // continue
}

My question is how can I access this variable without mocking random method?

I need this variable for my test scenarios.




Aucun commentaire:

Enregistrer un commentaire