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
This happens when your development and production environments are using different servlet API versions.
While building with tomcat7(for example) it supports servlet 3 and hence you will not receive any error.
While doing the same on a lower version tomcat, it will throw error.
Solution:
Either upgrade one of the environments to support servlet 3 or just downgrade your code to use servlet 2.5