private @Mock MyComponent instance;
private DefaultValidator validator;
@Before
public void setup() {
Proxifier proxifier = new JavassistProxifier(new ObjenesisInstanceCreator());
this.validator = new DefaultValidator(result, new DefaultValidationViewsFactory(result, proxifier), outjector, proxifier, beanValidator, localization);
when(result.use(LogicResult.class)).thenReturn(logicResult);
when(result.use(PageResult.class)).thenReturn(pageResult);
when(logicResult.forwardTo(MyComponent.class)).thenReturn(instance);
when(pageResult.of(MyComponent.class)).thenReturn(instance);