views:

36

answers:

1

In 'spring-test' there's mock classes for unit testing Servlets, which is very useful. Unfortuately, I do not need any of the other Spring componenets, and do not wish to depend on spring-core in my project.

It is possible to either:

  • Use spring-test without depending on spring-core, ... (i.e sever the mocking-classes from spring)?
  • Use an alternative mock library with similar functionality?
+1  A: 

One option would be the project Mockrunner, which is designed for testing J2EE components such as servlets, and which includes MockHttpServletRequest and Response objects.

JacobM
Sounds like what I need.
bjornl
In the continuation I will factor most/all of the logic out of the controller. I realize I have indulged in bad design practices.
bjornl