How do I test Guice injections?

后端 未结 4 1612
傲寒
傲寒 2020-12-13 04:39

I gave to Google Guice the responsibility of wiring my objects. But, how can I test if the bindings are working well?

For example, suppose we have a class A

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-13 05:21

    IMHO, you should not be testing that. The Google Guice guys have the unit tests to assert that the injections work as expected - after all, that's what Guice is designed to do. You should only be writing tests for your own code (A and B).

提交回复
热议问题