java - Calling controller from junit test -
how can call spring annotated controller junit test, in way spring comes play binding , all, without making http request (just mocking out request object)? has include whole shebang controller , down, jpa , database , all. using ejb, maybe bean can me?
the reason this, have automatic tests tests performance of specific controller calls, without client , network traffic.
thank you
there's section in spring reference unit-testing spring mvc.
here's relevant excerpt:
unit testing spring mvc controllers
test spring mvc controllers, usemodelandviewassert
combinedmockhttpservletrequest
,mockhttpsession
, , on org.springframework.mock.web package.
reference:
- org.springframework.mock.web package summary
- modelandviewassert javadoc
Comments
Post a Comment