1 package test.dataprovider; 2 3 import com.google.inject.Inject; 4 import com.google.inject.name.Named; 5 6 import org.testng.annotations.DataProvider; 7 8 public class ConstructorInjectionProvider { 9 10 private final String value; 11 12 @Inject 13 public ConstructorInjectionProvider(@Named("test") String value) { 14 this.value = value; 15 } 16 17 @DataProvider(name = "injection") 18 public Object[][] create() { 19 return new Object[][] { 20 new Object[] { value }, 21 }; 22 } 23 } 24