0

In below question I am I am confused by line : handle = adapter.handle(req, res, vc);

Set @ModelAttribute in MockHttpServletRequest in JUnit Test

How/where is the adapter object instantiated ?

Community
  • 1
  • 1
blue-sky
  • 51,962
  • 152
  • 427
  • 752

2 Answers2

3

The adapter object that he is referring to is a HandlerAdapter from the SpringSource docs. More specifically, it is the subclass AnnotationMethodHandlerAdapter

I also wanted to test my RESTful service in Spring MVC. Below are two links that were really helpful to me:

Unit Testing Controllers in Spring MVC

Using HandlerAdapter in integration tests

Community
  • 1
  • 1
Roy
  • 3,574
  • 2
  • 29
  • 39
0

Both the adapter and the WebTestExecutionerListener seem to be the OPs own code. There's no way of knowing short of asking him.

Sean Patrick Floyd
  • 292,901
  • 67
  • 465
  • 588