Test Java EE applications effectively

Needle is a lightweight framework for testing Java EE components outside of the container in isolation. It reduces the test setup code by analysing dependencies and automatic injection of mock objects. It will thus maximize the speed of development as well as the execution of unit tests.

Needle testing coffeecups logo


  • Instantiation of @ObjectUnderTest components
  • Constructor, method and field based injection
  • Injection of Mock objects by default
  • Extensible via custom injection providers
  • Wiring of object graphs
  • Database testing via JPA provider, e.g. Hibernate
  • EntityManager creation and injection
  • Execute database operations in setup and teardown
  • Transaction utilities
  • Utilities for reflection
  • Can be used with JUnit or TestNG
  • Supports EasyMock and Mockito out-of-the-box
Needle build status