我想實現一個Guice模塊,它將一個適配器綁定到一個命名參數,但爲了創建這個適配器,它需要實例化另一個類,它也需要注入參數。 這裏是Scala的例子: trait Service
class UserService @Inject()(@Named(value = "foo") foo: String) extends Service
trait Adapter
class Adapt
我正在編寫webDriver端到端測試框架,使用junit 4和guice進行注入。 我想測試名稱傳遞到我的driverFactory,這樣我可以用它來Saucelabs正確命名測試:在我AbstractTest (使用目前的所有測試)我使用 @Rule
public TestName name = new TestName();
和 @Before
public void