@Test public void onHttpResultShouldNotThrowExceptionsOnHeaders() throws Exception { HttpResult httpResult = mock(HttpResult.class); when(result.use(HttpResult.class)).thenReturn(httpResult); factory.instanceFor(HttpResult.class, errors); factory.instanceFor(HttpResult.class, errors).addDateHeader("abc", 123l); factory.instanceFor(HttpResult.class, errors).addHeader("def", "ghi"); factory.instanceFor(HttpResult.class, errors).addIntHeader("jkl", 456); factory.instanceFor(HttpResult.class, errors).addIntHeader("jkl", 456); }
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);  }