Welcome to the home of jmockring – a Java mocking facility for Spring applications.
Jmockring is an open-source Java test enhancement tool, simple to configure and use, yet sophisticated enough to provide the following:
- Deployment of Spring application on a lightweight web container directly from inside a JUnit test, removing dependencies on your build tool of choice (Maven/Ant, etc …). This means the test can be run and debugged directly from inside your favourite IDE.
- When application is deployed all unavailable Spring beans will be automatically mocked using Mockito framework, effectively creating a partial integration testing case.
- Turn a standard JUnit test class into a fully-fledged integration test, which can be used to exercise piece of code starting at the web servlet and going all the way down – or anything in-between.
- Bring the deployed server application close to the test execution, allowing to monitor standard servlet events, as well as events triggered by the Spring multicaster.
- Seamlessly integrates with JUnit via built-in extension points – runners, lifecycle monitors and rules.
- Easy to use and unobtrusive for the end user. Spring beans, auto-created mocks and other facilities are injected into the test class using Java 5 annotations – no need to extend anything or use unweildy utility classes.
- Be friendly to continuous integration build systems. In CI, multiple builds may execute tests simultaneously, creating racing conditions for TCP ports allocation for each running web container. To this end, ports in jmockring are allocated dynamically, relieving the developer from having to worry about such trivial concerns and focus on writing quality tests instead,