Skip to content

Instantly share code, notes, and snippets.

@koic
Created April 15, 2010 06:33
Show Gist options
  • Save koic/366765 to your computer and use it in GitHub Desktop.
Save koic/366765 to your computer and use it in GitHub Desktop.
Create mock object using jMock.
import org.jmock.cglib.MockObjectTestCase;
public class ExampleTest extends MockObjectTestCase {
public void testExample() throws Exception {
...
final Mock mock = new Mock(ClassName.class);
mock.expects(once()).method("methodName").will(returnValue("returnValue"));
mock.proxy();
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment