@Test(expected=ValidationException.class) public void onRefererResultShouldThrowExceptionsOnRedirect() throws Exception { RefererResult referer = mock(RefererResult.class); when(result.use(RefererResult.class)).thenReturn(referer); factory.instanceFor(RefererResult.class, errors).redirect(); }
public <T extends View> T instanceFor(final Class<T> view, final List<Message> errors) { if (view.equals(EmptyResult.class)) { throw new ValidationException(errors); } return proxifier.proxify(view, throwValidationErrorOnFinalMethods(view, errors, result.use(view))); }
DefaultValidationViewsFactory implements ValidationViewsFactory { public <T extends View> T instanceFor(final Class<T> view, final List<Message> errors) { if (view.equals(EmptyResult.class)) { throw new ValidationException(errors); } return proxifier.proxify(view, throwValidationErrorOnFinalMethods(view, errors, result.use(view))); } }
DefaultValidationViewsFactory implements ValidationViewsFactory { public <T extends View> T instanceFor(final Class<T> view, final List<Message> errors) { if (view.equals(EmptyResult.class)) { throw new ValidationException(errors); } return proxifier.proxify(view, throwValidationErrorOnFinalMethods(view, errors, result.use(view))); } DefaultValidationViewsFactory(Result result, Proxifier proxifier); }
DefaultValidationViewsFactory implements ValidationViewsFactory { public <T extends View> T instanceFor(final Class<T> view, final List<Message> errors) { if (view.equals(EmptyResult.class)) { throw new ValidationException(errors); } return proxifier.proxify(view, throwValidationErrorOnFinalMethods(view, errors, result.use(view))); } DefaultValidationViewsFactory(Result result, Proxifier proxifier); T instanceFor(final Class<T> view, final List<Message> errors); }
DefaultValidationViewsFactory implements ValidationViewsFactory { public <T extends View> T instanceFor(final Class<T> view, final List<Message> errors) { if (view.equals(EmptyResult.class)) { throw new ValidationException(errors); } return proxifier.proxify(view, throwValidationErrorOnFinalMethods(view, errors, result.use(view))); } DefaultValidationViewsFactory(Result result, Proxifier proxifier); T instanceFor(final Class<T> view, final List<Message> errors);  }