Reputation: 3808
What is the most effective way of unit testing JSF 2.0 managed beans. I have seen JSFUnit from JBoss but it looks like its for testing the components in the facelets pages but not the managed beans themselves.
I want to find a way to effectively unit test only the managed beans.
Any ideas?
Upvotes: 4
Views: 4962
Reputation: 346536
Set up your managed beans so that all their dependencies are injected as managed properties via setters. Then you can manually inject mocks or stubs in your unit tests.
Upvotes: 5