I have my project structure like below:
Where my Test1.java is like this:
package TestNG;
import org.testng.annotations.Test;
import com.google.inject.Inject;
import com.google.inject.name.Named;
public class Test1 {
@Inject
@Named("semi-auto.firstname")
String firstname;
@Test
public void test() {
System.out.println(firstname);
}
}
and my semi-auto.properties is
semi-auto.firstname=John
semi-auto.lastname=Doe
What I want to do is to just use 'firstname' parameter value in Test1 using Guice. The test passes but the value passed is null. Can't I do that this way? Please help