Hallo
I'm trying mockito and i like it.
but i have some problems. here is my first one
i am writing tests for a Class that needs to be initalized (but not always in the same whay). during this initialization methods of my mocks are called. this calles i would like to ignore in later verify(...) calles.
example:
public void test_myTestMethod()
{
// initializastion
testedClassInstance.init(); // <-- init will call myMock.foo()
// testedMethode
testedClassInstance.myMethod(); // <-- will call myMock.foo() too
// verification
verify( myMock).foo(); // this will fail because foo() was called twice
}
i would like to reset the call counter for myMock.foo() but i don't know how. do i need to call myMock.reset() in this case?