Skip to content

jinahya/dagger-testng

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dagger-testng

GitHub license Dependency Status Build Status Maven Central Domate via Paypal

This library enables Dagger works like @Guice. Inspired by hk2-testng.

dependencies

Add it as a test-scoped dependency.

<dependency>
  <groupId>com.github.jinahya</groupId>
  <artifactId>dagger-testng</artifactId>
  <scope>test</scope>
</dependency>

You, of course, should add related dependencies by yourself.

<dependency>
  <groupId>com.squareup.dagger</groupId>
  <artifactId>dagger</artifactId>
  <scope>test</scope>
</dependency>
<dependency>
  <groupId>com.squareup.dagger</groupId>
  <artifactId>dagger-compiler</artifactId>
  <scope>test</scope>
</dependency>
<dependency>
  <groupId>org.testng</groupId>
  <artifactId>testng</artifactId>
  <scope>test</scope>
</dependency>

usages

Use it just like you would do with @Guice or @HK2.

@Dagger(modules = MyModule.class)
public class MyTest {

    @Test
    public void test() {
    }

    @Inject
    String name;
}

[![Domate via Paypal](https://img.shields.io/badge/donate-paypal-blue.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_cart&business=A954LDFBW4B9N&lc=KR&item_name=GitHub&amount=5%2e00¤cy_code=USD&button_subtype=products&add=1&bn=PP%2dShopCartBF%3adonate%2dpaypal%2dblue%2epng%3aNonHosted)

About

Using Dagger with an annotation with TestNG

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages