You are using an older version of the Servlet specification (for example, 2.5); whereas the version of spring-test you are using requires at least Servlet 3.0.
As mentioned in the Testing Improvements section of the reference guide,
As with Spring 4.0, the mocks set in the org.springframework.mock.web package org.springframework.mock.web now based on the Servlet 3.0 API.
So, although Spring Framework 4.0 and 4.1 support Servlet 2.5 for deployment, mocks for Servlet and Spring MVC Test Framework servlets in the spring-test module require Servlet 3.0 (in particular, version 3.0.1 or higher).
Hi,
Sam ( spring-test module output)
source share