Error creating object MockHttpServletResponse for unit testing

后端 未结 3 2165
甜味超标
甜味超标 2021-01-12 17:07
  1. I was trying to write unit test for Servlet using sprint-test using mock object

  2. my maven dependency is:

    
       
    
            
3条回答
  •  情深已故
    2021-01-12 17:49

    I had a similar issue and solved it by adding this dependency to my pom and there is no need to change your javaee-api to javax.servlet

    
     org.mortbay.jetty
     servlet-api-2.5
     6.1.11
    
    

提交回复
热议问题