سؤال

I'm currently working on a project that involves building a REST api using JavaEE. The setup of the project is Tomcat, Hibernate, Wink and Jackson Json for the different json-views. At the moment the unit testing of the rest resources is very poor, we've written custom classes that using introspection find the method that corresponds to a given resource but it is getting in our way (all the workarounds that we need to do in order to execute a simple unit test). I did a little research and found this.

My question is how to "install(add)" the MockServletInvocationTest class and its dependencies to the project? We're not using Maven, nor Spring. Is there a way to use Spring modules (I think this mock class is in the Spring test-module) outside Spring and if yes, how?

هل كانت مفيدة؟

المحلول

I found a solution, so for those who are interested: just add the following jars to your WebContent/WEB-INF/lib:

  • spring-test-xx.jar
  • spring-core-xx.jar
  • wink-component-test-support-xx-incubating.jar
  • commons-logging-xx.jar

And everything workds fine.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top