vendredi 18 août 2017

How can I test this method using Mockito?

I have a method with complex interaction between different objects that I would like to test using the Mockito framework. I would appreciate some guidelines. I know the code does not mean much.

Both getInstance() methods are static.

public MyRequest getRequest(ObjectOne obj1, ObjectTwo obj2) {

    ObjectThree obj3 = FactoryOne.getInstance().getList().getObject(obj2.getId());


    if(FactoryTwo.getInstance().isFlagSet("flag")){
        ....
    }


    return new MyRequest(....);
}

Aucun commentaire:

Enregistrer un commentaire