문제

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