possibly, thanks for the reply. We ended up hacking AtUnit for now
and have our own container...too bad AtUnit doesn't have an annotation
like this one....@Container(GUICE, prodModule=ProductionModule.class)
though so no one would need this
public class UnitGuiceContainer extends GuiceContainer {
@Override
public Object createTest(Class<?> testClass, Map<Field, Object>
fieldValues)
throws Exception {
FieldModule fields = new FieldModule(fieldValues);
Injector injector;
if (Module.class.isAssignableFrom(testClass)) {
Module override = Modules.override(new
ProductionModule()).with(
(Module) testClass.newInstance());
injector = Guice.createInjector(fields, override);
} else {
injector = Guice.createInjector(fields);
}
return injector.getInstance(testClass);