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, use modelandviewassert combined mockhttpservletrequest, mockhttpsession, , on org.springframework.mock.web package.

reference:


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -