H开发者_运维知识库ow to unit test action classes ? frmework like mock runner allows to test action class. But say action class is calling service class and service class in turn calls dao class..How to resolve this issue ?
You need to stub/mock your service classes that are used by your action class. Let's say you have some action class that parses the input, chooses appropriate service, makes a call and give you some answer. So all you need to do is to create some dummy-service, inject it into your action object and do the tests. Mocking frameworks are to help you with creating those dummy services.
精彩评论