I'm using EasyMock 2.3 (tried Groovy Mocks as well, same problem) and it seems like one of the methods I have expected in my mock is still running the actual code. Example
| Code: |
public class Foo {
...
public int foo(Object, int) {
...
Bar otherClass = new Bar();
otherClass.doSomething();
...
}
...
|
Mock:
| Code: |
...
Foo mockFoo = createMock(Foo.class)
expect(mockFoo.foo(new Object(), 4)).andReturn(3);
...
|
There's the method I'm expecting, but when I mock it up it still runs that code. I'd love to know how to get it to work correctly. Anyone have any ideas?
Edit: BTW, I'm using ClassExtensions to mock the class.
Post edited by: lightguard, at: 2007/10/16 12:07