How do I avoid a conical bowl plate?
With Spring, I usually use @AutoWired, and this is it, no createInjector, no injectMemebers (this). Is there any way to avoid using while using giuce? Are there any global settings that I can do, will I automatically load all things into application and test classes?
public class AccountDaoTest {
@Before
public void setup() {
Injector injector;
injector = Guice.createInjector();
injector.injectMembers(this);
}
@Inject
AccountDAO accountDao ;
@Test
public void persist(){
Account ac = new Account();
ac.setName("AccountName");
ac.setAccountType(AccountType.Hospital);
accountDao.createAccount(ac);
}
}
source
share