How test guice injections?
- by yeraycaballero
I gave to Google Guice the responsability of wiring my objects. But, How can I test if the bindings are working well.
For example, suppose we have a class A which has a dependence B. How can I test than B is injected correctly.
class A {
private B b;
public A() {}
@Inject
public void setB(B b) {
this.b = b
}
}
Notice A hasn't got a getB() method and I want to assert that A.b isn't null.