MockControl ehc = newControl(ErrorHandler.class);
ErrorHandler eh = (ErrorHandler) ehc.getMock();
Log log = (Log) newMock(Log.class);
BuilderParameter parameter = new BuilderParameter();
module.getClassResolver();
mc.setReturnValue(new DefaultClassResolver());
module.getService(StringHolder.class);
mc.setThrowable(new ApplicationRuntimeException("Simulated failure."));
module.getErrorHandler();
mc.setReturnValue(eh);
eh.error(
log,
"Unable to autowire property stringHolder of service foo.bar: Simulated failure.",
null,
new ApplicationRuntimeException(""));
ehc.setMatcher(new ExceptionAwareArgumentsMatcher());
replayControls();
parameter.setClassName(ServiceAutowireTarget.class.getName());
parameter.setAutowireServices(true);
BuilderFactoryLogic logic = new BuilderFactoryLogic(module, log, "foo.bar", parameter);
ServiceAutowireTarget service = (ServiceAutowireTarget) logic.createService();