Currently I\'m using TestNG framework for testing application business logic, i added some Servlet classes recently.
How do I unit test these Servlet classes in Test
I suggest that you move all of the business logic out of the servlet classes, into your own classes which you can test. That leaves the servlets just as glue between your business logic and the container, with nothing in them worth testing.
The API classes such as HttpServletRequest
, ServletConfig
, etc, are prime targets for using a mocking framework of your choice (JMock, Mockito, etc), since they're all interfaces.