java - Does EasyMock do a object injection to JUnit code? -
i'm new both junit , easymock. need inject few of classes junit test.
private static themanager themanager; public static void setupbeforeclass() throws exception { themanager = easymock.createmock(themanagerimpl.class); themanager.init(); }
will instantiate object of "themanagerimpl"? figured not calling code within implementation. how can inquire easymock me?
easymock not create instance of themangerimpl, mock instance of it. thought if want test class uses themanagerimpl should not worry how themanager implemented, logic in class a. in case create mock themanager, inject instance of class , specify in test how class supposed phone call themanager (what method, parameters , themanager supposed return).
java junit easymock
No comments:
Post a Comment