EasyStub is a simple stubbing framework for Java. It was inspired by the EasyMock framework. EasyMock is great for mocking, but a little verbose for my tastes when using it for stubbing classes. EasyStub aims to fix that!
With EasyStub, much of the syntax is like EasyMock. You create a stub by calling:
and register a stub return like:
EasyStub.stub(stubInstance.aMethodOnClass()).withValue("a value to return");
Unlike EasyMock, no replaying or verifying of stubs takes place - there is no need. The stub also behaves as if you had created a stub class using an IDE - all methods return default values (null for object return types, false for boolean types and 0 for numeric primitive types).
Copyright © 2013 Black Duck Software, Inc. and its contributors, Some Rights Reserved. Unless otherwise marked, this work is licensed under a Creative Commons Attribution 3.0 Unported License . Ohloh ® and the Ohloh logo are trademarks of Black Duck Software, Inc. in the United States and/or other jurisdictions. All other trademarks are the property of their respective holders.