Blog

Google Guice で、Module の設定を上書きしたい

テストコード等で Module の設定を上書きしたいトキがあると思う。 そういう時には Modules.override() を使えばいい。

Guice.createInjector(Modules.override(new ProductionModule()).with(new TestModule()));

とかそういう感じ。

ref. http://stackoverflow.com/questions/483087/overriding-binding-in-guice