Search code examples
web-applicationsspring-mvcopen-sourcejunit4

open source web application with junit Testing?


We are thinking of using junit testing in our next spring MVC based web applications. But no one in the team has any prior experience in the junit testing.

Offcourse we have read some online junit tutorials and some books on junit testing for references.

But its better if we go through some existing web apps which uses junit testing so that we can see how it is used. We dont want to use it in the wring way or improperly.

So is there any such open source web apps which we can study or go through to understand how junit tests are written?


Solution

  • As a starting point you could checkout Spring Samples source code which will have a sample webapp and unit tests. This should help to get you started.

    After that you could look at Spring testing framework, this helps with integration tests etc. The latest version of Spring ships with Spring MVC Test which is very useful for testing your MVC controllers.

    Also if you are looking for a mocking framework I would suggest Mockito.

    Enjoy M