Yesterday, I wrote a small article talking about Guice and JUnit, so, this time, I’ll just say how to use the small lib that I build (not big deal, one class, one annotation =] )

So, I dont push it to maven central yet, so, you will need to do some work to made it work. Yep, you will need to build and install it to your local repository.

$ git clone git://
$ cd gunit
$ mvn install

Now, just add it in your pom.xml dependencies:


And follow the instructions code example and the motivation of doing this in this article, but, basically, your tests will look like this:

public class FooTests {

	@Inject Bar bar;

	public void testBar(){

Get the code.