Created
April 15, 2010 06:33
-
-
Save koic/366765 to your computer and use it in GitHub Desktop.
Create mock object using jMock.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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