java - How to unit test spring mvc interceptors without controller class -


i trying write unit test 1 of interceptors in spring-mvc rest application. using:

 - testng 6.8.7 - mockito 1.9.5 - spring 4.0.0 

is mandatory have controllers unit test interceptors? can write unit test without writing controller?

thanks,nn

assuming mean handlerinterceptor,

is mandatory have controllers unit test interceptors?

no. unit test meant self contained possible. if you're unit testing handlerinterceptor implementation, things involved implementation , of dependencies.

can write unit test without writing controller?

yes. handlerinterceptor interface 3 (3) methods. none of methods require controller, don't need controller.


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -