How do I Unit Test HTTPServlet?

后端 未结 3 579
说谎
说谎 2021-01-14 18:14

I want to test my servlet with http://www.easymock.org/

How do I write the Unit Testing Code?

I update my code with your responce.

I just used Google

3条回答
  •  孤独总比滥情好
    2021-01-14 18:51

    I prefer using spring-test and the MockHttpServletRequest and MockHttpServletResponse. They are more stub like than mocks, but work really well.

    This answer has information regarding the usage: How to test my servlet using JUnit

提交回复
热议问题