lundi 1 juin 2015

Groovy / Spock test a Java class that has a member @Inject

I am trying to test a Java class that has a member injected using @Inject.

I want to test the someMethod

public class SomeJavaClass {

    @Inject
    private SomeFactory someFactory;

    private SomeDAO someMethod(Map someMap) {
        SomeDAO someDAO = someFactory.create();
        //some code
    }
}

My class does not have a explicit constructor

Aucun commentaire:

Enregistrer un commentaire