java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.isAsyncStarted() while using Mockito with Junit

前端 未结 6 701
清歌不尽
清歌不尽 2020-12-20 13:48

I am trying to get my feet wet with TDD. I am trying to write unit test cases for controllers using Mockito in conjunction with MockMvc and Junit.

But I am getting a

6条回答
  •  情书的邮戳
    2020-12-20 14:07

    I found the solution for my error. The actual servlet api that was getting provided was of gwt-servlet.jar and the servlet-api in the gwt-servlet.jar was of the older version. Thus I had configure my build path to make the project point to the latest servlet-api while building.

    As for the correct answer, I think my vote goes to Jens since he did gave the solution closest as per the scenario.

    Thanks everyone. :)

提交回复
热议问题