File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Groovy and the fly likes Mocking/Stubbing Class with Static Factory Method and Regular Methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Groovy
Bookmark "Mocking/Stubbing Class with Static Factory Method and Regular Methods" Watch "Mocking/Stubbing Class with Static Factory Method and Regular Methods" New topic
Author

Mocking/Stubbing Class with Static Factory Method and Regular Methods

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Another question, again regarding testing using MockFor or StubFor:
If I want to mock/stub a class like Calendar that has a static factory method to create instances of the class and also regular methods, I don't know how to return the mock/stub from the factory method.
Here is my code so far:

Many thanks in advance!
 
wood burning stoves
 
subject: Mocking/Stubbing Class with Static Factory Method and Regular Methods
 
Similar Threads
What are static factory methods
Factory Method/Abstract Factory
what are singleton classes ?
How to redirect an OutputStream
Instance of an abstract class